From 0d51ede6b30499c5adb821b87fb5c20c0ea973bf Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 9 Feb 2026 13:58:52 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.709.1 --- .speakeasy/workflow.lock | 16 +- sync-for-payables/.gitignore | 5 + sync-for-payables/.speakeasy/gen.lock | 2111 +++++++++++++---- sync-for-payables/.speakeasy/gen.yaml | 24 +- .../Codat/Sync/Payables/BankAccounts.cs | 152 +- .../Codat/Sync/Payables/BillPayments.cs | 274 ++- .../Codat/Sync/Payables/Bills.cs | 978 ++++++-- .../Sync/Payables/Codat.Sync.Payables.csproj | 35 +- .../Codat/Sync/Payables/CodatSyncPayables.cs | 279 ++- .../Codat/Sync/Payables/Companies.cs | 851 +++++-- .../Codat/Sync/Payables/CompanyInformation.cs | 148 +- .../Codat/Sync/Payables/Connections.cs | 600 ++++- .../Codat/Sync/Payables/Hooks/HookTypes.cs | 44 +- .../Codat/Sync/Payables/Hooks/SDKHooks.cs | 62 +- .../Models/Components/AccountMappingOption.cs | 8 +- .../Models/Components/AccountStatus.cs | 3 +- .../Payables/Models/Components/Address.cs | 7 +- .../Payables/Models/Components/AddressType.cs | 5 +- .../Payables/Models/Components/Attachment.cs | 22 +- .../Models/Components/AttachmentUpload.cs | 5 +- .../Payables/Models/Components/BankAccount.cs | 15 +- .../Components/BankAccountMappingOption.cs | 14 +- .../Models/Components/BankAccountPrototype.cs | 15 +- .../Models/Components/BankAccountStatus.cs | 3 +- .../Models/Components/BankAccountType.cs | 6 +- .../Sync/Payables/Models/Components/Bill.cs | 13 +- .../Models/Components/BillAccountRef.cs | 5 +- .../Models/Components/BillLineItem.cs | 13 +- .../Models/Components/BillMappingOptions.cs | 7 +- .../Payables/Models/Components/BillPayment.cs | 8 +- .../Components/BillPaymentAccountRef.cs | 5 +- .../Models/Components/BillPaymentPrototype.cs | 8 +- .../Models/Components/BillPrototype.cs | 11 +- .../Payables/Models/Components/BillStatus.cs | 3 +- .../Models/Components/BillTaxRateRef.cs | 3 +- .../Sync/Payables/Models/Components/Bills.cs | 3 +- .../ClientRateLimitReachedWebhook.cs | 63 - .../ClientRateLimitReachedWebhookData.cs | 51 - .../Components/ClientRateLimitResetWebhook.cs | 63 - .../ClientRateLimitResetWebhookData.cs | 63 - .../Components/ClientRateLimitWebhook.cs | 8 +- .../ClientRateLimitWebhookPayload.cs | 8 +- .../Payables/Models/Components/CodatFile.cs | 3 +- .../Payables/Models/Components/Companies.cs | 3 +- .../Payables/Models/Components/Company.cs | 18 +- .../Models/Components/CompanyInformation.cs | 3 +- .../Models/Components/CompanyReference.cs | 5 +- .../Components/CompanyReferenceLinks.cs | 3 +- .../Models/Components/CompanyRequestBody.cs | 3 +- .../Models/Components/CompanyUpdateRequest.cs | 36 + .../Payables/Models/Components/Connection.cs | 24 +- .../Payables/Models/Components/Connections.cs | 3 +- .../Models/Components/DataConnectionError.cs | 13 +- .../Models/Components/DataConnectionStatus.cs | 3 +- .../Payables/Models/Components/DataType.cs | 59 + .../Payables/Models/Components/ErrorStatus.cs | 3 +- .../Models/Components/ErrorValidation.cs | 3 +- .../Models/Components/ErrorValidationItem.cs | 5 +- .../Sync/Payables/Models/Components/HalRef.cs | 3 +- .../Sync/Payables/Models/Components/Links.cs | 3 +- .../Payables/Models/Components/Pagination.cs | 3 +- .../Components/PaymentMappingOptions.cs | 7 +- .../Payables/Models/Components/Security.cs | 3 +- .../Payables/Models/Components/SourceType.cs | 3 +- .../Payables/Models/Components/Supplier.cs | 11 +- .../Models/Components/SupplierPrototype.cs | 5 +- .../Payables/Models/Components/SupplierRef.cs | 7 +- .../Models/Components/SupplierStatus.cs | 3 +- .../Payables/Models/Components/Suppliers.cs | 3 +- .../Models/Components/TaxRateMappingOption.cs | 8 +- .../Models/Components/TaxRateStatus.cs | 8 +- .../Payables/Models/Components/TrackingRef.cs | 36 + .../Errors/CodatSyncPayablesException.cs | 83 + .../Payables/Models/Errors/ErrorMessage.cs | 58 +- .../Errors/ResponseValidationException.cs | 29 + .../Payables/Models/Errors/SDKException.cs | 37 +- .../Requests/CreateBankAccountRequest.cs | 3 +- .../Requests/CreateBankAccountResponse.cs | 13 +- .../Requests/CreateBillPaymentRequest.cs | 3 +- .../Requests/CreateBillPaymentResponse.cs | 13 +- .../Models/Requests/CreateBillRequest.cs | 3 +- .../Models/Requests/CreateBillResponse.cs | 13 +- .../Models/Requests/CreateCompanyResponse.cs | 13 +- .../Requests/CreateConnectionRequest.cs | 3 +- .../Requests/CreateConnectionRequestBody.cs | 3 +- .../Requests/CreateConnectionResponse.cs | 13 +- .../Models/Requests/CreateSupplierRequest.cs | 3 +- .../Models/Requests/CreateSupplierResponse.cs | 13 +- .../Models/Requests/DeleteCompanyRequest.cs | 3 +- .../Models/Requests/DeleteCompanyResponse.cs | 11 +- .../Requests/DeleteConnectionRequest.cs | 3 +- .../Requests/DeleteConnectionResponse.cs | 11 +- .../Requests/DownloadBillAttachmentRequest.cs | 3 +- .../DownloadBillAttachmentResponse.cs | 13 +- .../Requests/GetCompanyInformationRequest.cs | 3 +- .../Requests/GetCompanyInformationResponse.cs | 13 +- .../Models/Requests/GetCompanyRequest.cs | 3 +- .../Models/Requests/GetCompanyResponse.cs | 13 +- .../Models/Requests/GetConnectionRequest.cs | 3 +- .../Models/Requests/GetConnectionResponse.cs | 13 +- .../Requests/GetMappingOptionsBillsRequest.cs | 5 +- .../GetMappingOptionsBillsResponse.cs | 13 +- .../GetMappingOptionsPaymentsRequest.cs | 5 +- .../GetMappingOptionsPaymentsResponse.cs | 13 +- .../Requests/ListBillAttachmentsRequest.cs | 3 +- .../Requests/ListBillAttachmentsResponse.cs | 13 +- .../Models/Requests/ListBillsRequest.cs | 5 +- .../Models/Requests/ListBillsResponse.cs | 13 +- .../Models/Requests/ListCompaniesRequest.cs | 9 +- .../Models/Requests/ListCompaniesResponse.cs | 13 +- .../Models/Requests/ListConnectionsRequest.cs | 3 +- .../Requests/ListConnectionsResponse.cs | 13 +- .../Models/Requests/ListSuppliersRequest.cs | 5 +- .../Models/Requests/ListSuppliersResponse.cs | 13 +- .../Models/Requests/ReplaceCompanyRequest.cs | 26 + .../ReplaceCompanyResponse.cs} | 21 +- .../Requests/UnlinkConnectionRequest.cs | 3 +- .../Requests/UnlinkConnectionResponse.cs | 13 +- .../UnlinkConnectionUpdateConnection.cs | 3 +- .../Models/Requests/UpdateBillRequest.cs | 44 + .../UpdateBillResponse.cs} | 21 +- .../Models/Requests/UpdateCompanyRequest.cs | 5 +- .../Models/Requests/UpdateCompanyResponse.cs | 13 +- .../Requests/UploadBillAttachmentRequest.cs | 3 +- .../Requests/UploadBillAttachmentResponse.cs | 15 +- .../ClientRateLimitReachedResponse.cs | 11 +- .../Webhooks/ClientRateLimitResetResponse.cs | 11 +- .../Codat/Sync/Payables/SDKConfig.cs | 63 + .../Codat/Sync/Payables/Suppliers.cs | 271 ++- .../Codat/Sync/Payables/Utils/Constants.cs | 38 + .../Sync/Payables/Utils/OpenEnumConverter.cs | 62 + .../Payables/Utils/RequestBodySerializer.cs | 103 +- .../Utils/ResponseBodyDeserializer.cs | 10 + .../Payables/Utils/Retries/BackoffStrategy.cs | 3 + .../Sync/Payables/Utils/Retries/Retries.cs | 21 + .../Payables/Utils/Retries/RetryConfig.cs | 11 + .../Sync/Payables/Utils/SecurityMetadata.cs | 2 + .../Payables/Utils/SpeakeasyHttpClient.cs | 5 +- .../Codat/Sync/Payables/Utils/URLBuilder.cs | 102 +- .../Codat/Sync/Payables/Utils/Utilities.cs | 16 + sync-for-payables/NUGET.md | 243 +- sync-for-payables/README.md | 279 ++- sync-for-payables/RELEASES.md | 12 +- sync-for-payables/USAGE.md | 5 +- .../Models/Components/AccountMappingOption.md | 4 +- .../docs/Models/Components/Attachment.md | 4 +- .../docs/Models/Components/BankAccount.md | 4 +- .../Components/BankAccountMappingOption.md | 2 +- .../Models/Components/BankAccountPrototype.md | 2 +- .../docs/Models/Components/Bill.md | 8 +- .../docs/Models/Components/BillLineItem.md | 9 +- .../docs/Models/Components/BillPayment.md | 2 +- .../Models/Components/BillPaymentPrototype.md | 2 +- .../docs/Models/Components/BillPrototype.md | 6 +- .../ClientRateLimitReachedWebhook.md | 16 - .../ClientRateLimitReachedWebhookData.md | 9 - .../Components/ClientRateLimitResetWebhook.md | 16 - .../Components/ClientRateLimitWebhook.md | 4 +- .../ClientRateLimitWebhookPayload.md | 2 +- .../docs/Models/Components/Company.md | 4 +- .../Models/Components/CompanyUpdateRequest.md | 10 + .../docs/Models/Components/Connection.md | 6 +- .../Models/Components/DataConnectionError.md | 4 +- .../docs/Models/Components/DataType.md | 11 + .../docs/Models/Components/Supplier.md | 24 +- .../Models/Components/SupplierPrototype.md | 20 +- .../docs/Models/Components/TrackingRef.md | 10 + .../Requests/CreateBillPaymentRequest.md | 14 +- .../Models/Requests/CreateCompanyResponse.md | 12 +- .../Requests/DownloadBillAttachmentRequest.md | 12 +- .../Models/Requests/GetCompanyResponse.md | 12 +- .../Requests/ListBillAttachmentsRequest.md | 10 +- .../Models/Requests/ListCompaniesRequest.md | 13 +- .../Models/Requests/ReplaceCompanyRequest.md | 9 + .../ReplaceCompanyResponse.md} | 14 +- .../docs/Models/Requests/UpdateBillRequest.md | 12 + .../UpdateBillResponse.md} | 5 +- .../Models/Requests/UpdateCompanyRequest.md | 8 +- .../Models/Requests/UpdateCompanyResponse.md | 12 +- .../Requests/UploadBillAttachmentRequest.md | 12 +- .../Webhooks/ClientRateLimitResetResponse1.md | 10 - .../docs/sdks/bankaccounts/README.md | 42 +- .../docs/sdks/billpayments/README.md | 80 +- sync-for-payables/docs/sdks/bills/README.md | 462 +++- .../docs/sdks/codatsyncpayables/README.md | 36 - .../docs/sdks/companies/README.md | 302 ++- .../docs/sdks/companyinformation/README.md | 7 +- .../docs/sdks/connections/README.md | 57 +- .../docs/sdks/suppliers/README.md | 168 +- 189 files changed, 7320 insertions(+), 2431 deletions(-) delete mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhook.cs delete mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhookData.cs delete mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhook.cs delete mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhookData.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyUpdateRequest.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/DataType.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Components/TrackingRef.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Errors/ResponseValidationException.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyRequest.cs rename sync-for-payables/Codat/Sync/Payables/Models/{Webhooks/ClientRateLimitReachedResponse1.cs => Requests/ReplaceCompanyResponse.cs} (70%) create mode 100644 sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillRequest.cs rename sync-for-payables/Codat/Sync/Payables/Models/{Webhooks/ClientRateLimitResetResponse1.cs => Requests/UpdateBillResponse.cs} (71%) create mode 100644 sync-for-payables/Codat/Sync/Payables/SDKConfig.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Utils/Constants.cs create mode 100644 sync-for-payables/Codat/Sync/Payables/Utils/OpenEnumConverter.cs delete mode 100644 sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhook.md delete mode 100644 sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhookData.md delete mode 100644 sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhook.md create mode 100644 sync-for-payables/docs/Models/Components/CompanyUpdateRequest.md create mode 100644 sync-for-payables/docs/Models/Components/DataType.md create mode 100644 sync-for-payables/docs/Models/Components/TrackingRef.md create mode 100644 sync-for-payables/docs/Models/Requests/ReplaceCompanyRequest.md rename sync-for-payables/docs/Models/{Components/ClientRateLimitResetWebhookData.md => Requests/ReplaceCompanyResponse.md} (79%) create mode 100644 sync-for-payables/docs/Models/Requests/UpdateBillRequest.md rename sync-for-payables/docs/Models/{Webhooks/ClientRateLimitReachedResponse1.md => Requests/UpdateBillResponse.md} (82%) delete mode 100644 sync-for-payables/docs/Models/Webhooks/ClientRateLimitResetResponse1.md delete mode 100644 sync-for-payables/docs/sdks/codatsyncpayables/README.md diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7b0ae60fe..435f25ef2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.696.0 +speakeasyVersion: 1.709.1 sources: bank-feeds-source: sourceNamespace: bank-feeds-source @@ -42,11 +42,11 @@ sources: - prealpha sync-for-payables-source: sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:9bf594a869e0b9e326b3437e9661b5a7f2f7da420d4fb7375a4a9938a168951c - sourceBlobDigest: sha256:57b656eed2c5a98f97da8f59e196bb8052ead3cc7c87673cdf5e19c6badbb570 + sourceRevisionDigest: sha256:9bd9e36fdb60e3d73fe7cc209c24ce0325919a523acec3edd84ee2f26420bedc + sourceBlobDigest: sha256:59b5c9d3aa1a43fa4186c6ae1bf1108bf40d44d22f65ed6118b763574e0cf669 tags: - latest - - speakeasy-sdk-regen-1732641065 + - speakeasy-sdk-regen-1770645493 - 3.0.0 sync-for-payables-version-1-source: sourceNamespace: sync-for-payables-version-1-source @@ -101,10 +101,10 @@ targets: sync-for-payables-library: source: sync-for-payables-source sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:9bf594a869e0b9e326b3437e9661b5a7f2f7da420d4fb7375a4a9938a168951c - sourceBlobDigest: sha256:57b656eed2c5a98f97da8f59e196bb8052ead3cc7c87673cdf5e19c6badbb570 - codeSamplesNamespace: sync-for-payables-source-code-samples - codeSamplesRevisionDigest: sha256:956525cb89c12c0ab52334de08ce92639ff61c9c97e9a34aa55aa2e9a4177fe6 + sourceRevisionDigest: sha256:9bd9e36fdb60e3d73fe7cc209c24ce0325919a523acec3edd84ee2f26420bedc + sourceBlobDigest: sha256:59b5c9d3aa1a43fa4186c6ae1bf1108bf40d44d22f65ed6118b763574e0cf669 + codeSamplesNamespace: sync-for-payables-source-csharp-code-samples + codeSamplesRevisionDigest: sha256:30bcb4eb66da40861ecadbd3ff5846ab49f3c978ac1fa7a46ef43be2f525c071 sync-for-payables-version-1-library: source: sync-for-payables-version-1-source sourceNamespace: sync-for-payables-version-1-source diff --git a/sync-for-payables/.gitignore b/sync-for-payables/.gitignore index b004ecedd..a3f0a5df4 100644 --- a/sync-for-payables/.gitignore +++ b/sync-for-payables/.gitignore @@ -1,3 +1,8 @@ +.DS_Store +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.env +.env.local obj/ bin/ debug/ diff --git a/sync-for-payables/.speakeasy/gen.lock b/sync-for-payables/.speakeasy/gen.lock index 59f0f8f86..c582f6ffb 100644 --- a/sync-for-payables/.speakeasy/gen.lock +++ b/sync-for-payables/.speakeasy/gen.lock @@ -1,302 +1,1089 @@ lockVersion: 2.0.0 id: 00cbdd6c-b863-4d25-8a48-4bec7ae20fc1 management: - docChecksum: 05c2a60eb0f4b40cda5e4a92d94e7b93 + docChecksum: 2c97e4172eda0b5a31c6dc31f428235d docVersion: 3.0.0 - speakeasyVersion: 1.447.0 - generationVersion: 2.463.0 - releaseVersion: 10.0.0 - configChecksum: ea66f426fff449b9489cf945c3268ed1 + speakeasyVersion: 1.709.1 + generationVersion: 2.812.2 + releaseVersion: 10.1.0 + configChecksum: d382bc2dd8aef4c90377cb4e45ea40f9 repoURL: https://github.com/codatio/client-sdk-csharp.git repoSubDirectory: sync-for-payables published: true +persistentEdits: + generation_id: f331df6e-5a24-4978-88b8-ceb8118fde98 + pristine_commit_hash: d939fd2b9cafeebbb3c33275847597bda1ca15cd + pristine_tree_hash: 86d29069a9115d2e9fe15a1b499ca6f0e223aa4d features: csharp: additionalDependencies: 0.1.0 - constsAndDefaults: 0.0.1 - core: 3.10.6 + constsAndDefaults: 0.0.2 + core: 3.15.11 decimal: 0.1.0 - deprecations: 2.81.2 - examples: 2.81.3 - globalSecurity: 2.83.6 + examples: 2.81.6 + globalSecurity: 2.83.9 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 - globalServerURLs: 2.82.3 + globalServerURLs: 2.83.0 intellisenseMarkdownSupport: 0.1.0 - methodArguments: 0.1.0 + methodArguments: 0.2.1 nameOverrides: 2.81.2 - nullables: 0.1.0 + nullables: 0.1.1 responseFormat: 0.0.4 retries: 0.0.1 - sdkHooks: 0.1.0 + sdkHooks: 0.3.0 + serverEventsSentinels: 0.2.0 webhooks: 1.0.0 -generatedFiles: - - .gitattributes - - CONTRIBUTING.md - - Codat.Sync.Payables.sln - - Codat/Sync/Payables/BankAccounts.cs - - Codat/Sync/Payables/BillPayments.cs - - Codat/Sync/Payables/Bills.cs - - Codat/Sync/Payables/Codat.Sync.Payables.csproj - - Codat/Sync/Payables/CodatSyncPayables.cs - - Codat/Sync/Payables/Companies.cs - - Codat/Sync/Payables/CompanyInformation.cs - - Codat/Sync/Payables/Connections.cs - - Codat/Sync/Payables/Hooks/HookTypes.cs - - Codat/Sync/Payables/Hooks/SDKHooks.cs - - Codat/Sync/Payables/Models/Components/AccountMappingOption.cs - - Codat/Sync/Payables/Models/Components/AccountStatus.cs - - Codat/Sync/Payables/Models/Components/Address.cs - - Codat/Sync/Payables/Models/Components/AddressType.cs - - Codat/Sync/Payables/Models/Components/Attachment.cs - - Codat/Sync/Payables/Models/Components/AttachmentUpload.cs - - Codat/Sync/Payables/Models/Components/BankAccount.cs - - Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs - - Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs - - Codat/Sync/Payables/Models/Components/BankAccountStatus.cs - - Codat/Sync/Payables/Models/Components/BankAccountType.cs - - Codat/Sync/Payables/Models/Components/Bill.cs - - Codat/Sync/Payables/Models/Components/BillAccountRef.cs - - Codat/Sync/Payables/Models/Components/BillLineItem.cs - - Codat/Sync/Payables/Models/Components/BillMappingOptions.cs - - Codat/Sync/Payables/Models/Components/BillPayment.cs - - Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs - - Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs - - Codat/Sync/Payables/Models/Components/BillPrototype.cs - - Codat/Sync/Payables/Models/Components/BillStatus.cs - - Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs - - Codat/Sync/Payables/Models/Components/Bills.cs - - Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhook.cs - - Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhookData.cs - - Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhook.cs - - Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhookData.cs - - Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs - - Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs - - Codat/Sync/Payables/Models/Components/CodatFile.cs - - Codat/Sync/Payables/Models/Components/Companies.cs - - Codat/Sync/Payables/Models/Components/Company.cs - - Codat/Sync/Payables/Models/Components/CompanyInformation.cs - - Codat/Sync/Payables/Models/Components/CompanyReference.cs - - Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs - - Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs - - Codat/Sync/Payables/Models/Components/Connection.cs - - Codat/Sync/Payables/Models/Components/Connections.cs - - Codat/Sync/Payables/Models/Components/DataConnectionError.cs - - Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs - - Codat/Sync/Payables/Models/Components/ErrorStatus.cs - - Codat/Sync/Payables/Models/Components/ErrorValidation.cs - - Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs - - Codat/Sync/Payables/Models/Components/HalRef.cs - - Codat/Sync/Payables/Models/Components/Links.cs - - Codat/Sync/Payables/Models/Components/Pagination.cs - - Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs - - Codat/Sync/Payables/Models/Components/Security.cs - - Codat/Sync/Payables/Models/Components/SourceType.cs - - Codat/Sync/Payables/Models/Components/Supplier.cs - - Codat/Sync/Payables/Models/Components/SupplierPrototype.cs - - Codat/Sync/Payables/Models/Components/SupplierRef.cs - - Codat/Sync/Payables/Models/Components/SupplierStatus.cs - - Codat/Sync/Payables/Models/Components/Suppliers.cs - - Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs - - Codat/Sync/Payables/Models/Components/TaxRateStatus.cs - - Codat/Sync/Payables/Models/Errors/ErrorMessage.cs - - Codat/Sync/Payables/Models/Errors/SDKException.cs - - Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs - - Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs - - Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs - - Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs - - Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs - - Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs - - Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs - - Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs - - Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs - - Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs - - Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs - - Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs - - Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs - - Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs - - Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs - - Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs - - Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs - - Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs - - Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs - - Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs - - Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs - - Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs - - Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs - - Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs - - Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs - - Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs - - Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs - - Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs - - Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs - - Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs - - Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs - - Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs - - Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs - - Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs - - Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs - - Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs - - Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs - - Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs - - Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs - - Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs - - Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs - - Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs - - Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs - - Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs - - Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs - - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs - - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse1.cs - - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs - - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse1.cs - - Codat/Sync/Payables/Suppliers.cs - - Codat/Sync/Payables/Utils/AnyDeserializer.cs - - Codat/Sync/Payables/Utils/BigIntStrConverter.cs - - Codat/Sync/Payables/Utils/DecimalStrConverter.cs - - Codat/Sync/Payables/Utils/EnumConverter.cs - - Codat/Sync/Payables/Utils/FlexibleObjectDeserializer.cs - - Codat/Sync/Payables/Utils/HeaderSerializer.cs - - Codat/Sync/Payables/Utils/IsoDateTimeSerializer.cs - - Codat/Sync/Payables/Utils/RequestBodySerializer.cs - - Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs - - Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs - - Codat/Sync/Payables/Utils/Retries/Retries.cs - - Codat/Sync/Payables/Utils/Retries/RetryConfig.cs - - Codat/Sync/Payables/Utils/SecurityMetadata.cs - - Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs - - Codat/Sync/Payables/Utils/SpeakeasyMetadata.cs - - Codat/Sync/Payables/Utils/URLBuilder.cs - - Codat/Sync/Payables/Utils/Utilities.cs - - NUGET.md - - USAGE.md - - docs/Models/Components/AccountMappingOption.md - - docs/Models/Components/AccountStatus.md - - docs/Models/Components/Address.md - - docs/Models/Components/AddressType.md - - docs/Models/Components/Attachment.md - - docs/Models/Components/AttachmentUpload.md - - docs/Models/Components/BankAccount.md - - docs/Models/Components/BankAccountMappingOption.md - - docs/Models/Components/BankAccountPrototype.md - - docs/Models/Components/BankAccountStatus.md - - docs/Models/Components/BankAccountType.md - - docs/Models/Components/Bill.md - - docs/Models/Components/BillAccountRef.md - - docs/Models/Components/BillLineItem.md - - docs/Models/Components/BillMappingOptions.md - - docs/Models/Components/BillPayment.md - - docs/Models/Components/BillPaymentAccountRef.md - - docs/Models/Components/BillPaymentPrototype.md - - docs/Models/Components/BillPrototype.md - - docs/Models/Components/BillStatus.md - - docs/Models/Components/BillTaxRateRef.md - - docs/Models/Components/Bills.md - - docs/Models/Components/ClientRateLimitReachedWebhook.md - - docs/Models/Components/ClientRateLimitReachedWebhookData.md - - docs/Models/Components/ClientRateLimitResetWebhook.md - - docs/Models/Components/ClientRateLimitResetWebhookData.md - - docs/Models/Components/ClientRateLimitWebhook.md - - docs/Models/Components/ClientRateLimitWebhookPayload.md - - docs/Models/Components/CodatFile.md - - docs/Models/Components/Companies.md - - docs/Models/Components/Company.md - - docs/Models/Components/CompanyInformation.md - - docs/Models/Components/CompanyReference.md - - docs/Models/Components/CompanyReferenceLinks.md - - docs/Models/Components/CompanyRequestBody.md - - docs/Models/Components/Connection.md - - docs/Models/Components/Connections.md - - docs/Models/Components/DataConnectionError.md - - docs/Models/Components/DataConnectionStatus.md - - docs/Models/Components/ErrorStatus.md - - docs/Models/Components/ErrorValidation.md - - docs/Models/Components/ErrorValidationItem.md - - docs/Models/Components/HalRef.md - - docs/Models/Components/Links.md - - docs/Models/Components/Pagination.md - - docs/Models/Components/PaymentMappingOptions.md - - docs/Models/Components/Security.md - - docs/Models/Components/SourceType.md - - docs/Models/Components/Supplier.md - - docs/Models/Components/SupplierPrototype.md - - docs/Models/Components/SupplierRef.md - - docs/Models/Components/SupplierStatus.md - - docs/Models/Components/Suppliers.md - - docs/Models/Components/TaxRateMappingOption.md - - docs/Models/Components/TaxRateStatus.md - - docs/Models/Errors/ErrorMessage.md - - docs/Models/Requests/CreateBankAccountRequest.md - - docs/Models/Requests/CreateBankAccountResponse.md - - docs/Models/Requests/CreateBillPaymentRequest.md - - docs/Models/Requests/CreateBillPaymentResponse.md - - docs/Models/Requests/CreateBillRequest.md - - docs/Models/Requests/CreateBillResponse.md - - docs/Models/Requests/CreateCompanyResponse.md - - docs/Models/Requests/CreateConnectionRequest.md - - docs/Models/Requests/CreateConnectionRequestBody.md - - docs/Models/Requests/CreateConnectionResponse.md - - docs/Models/Requests/CreateSupplierRequest.md - - docs/Models/Requests/CreateSupplierResponse.md - - docs/Models/Requests/DeleteCompanyRequest.md - - docs/Models/Requests/DeleteCompanyResponse.md - - docs/Models/Requests/DeleteConnectionRequest.md - - docs/Models/Requests/DeleteConnectionResponse.md - - docs/Models/Requests/DownloadBillAttachmentRequest.md - - docs/Models/Requests/DownloadBillAttachmentResponse.md - - docs/Models/Requests/GetCompanyInformationRequest.md - - docs/Models/Requests/GetCompanyInformationResponse.md - - docs/Models/Requests/GetCompanyRequest.md - - docs/Models/Requests/GetCompanyResponse.md - - docs/Models/Requests/GetConnectionRequest.md - - docs/Models/Requests/GetConnectionResponse.md - - docs/Models/Requests/GetMappingOptionsBillsRequest.md - - docs/Models/Requests/GetMappingOptionsBillsResponse.md - - docs/Models/Requests/GetMappingOptionsPaymentsRequest.md - - docs/Models/Requests/GetMappingOptionsPaymentsResponse.md - - docs/Models/Requests/ListBillAttachmentsRequest.md - - docs/Models/Requests/ListBillAttachmentsResponse.md - - docs/Models/Requests/ListBillsRequest.md - - docs/Models/Requests/ListBillsResponse.md - - docs/Models/Requests/ListCompaniesRequest.md - - docs/Models/Requests/ListCompaniesResponse.md - - docs/Models/Requests/ListConnectionsRequest.md - - docs/Models/Requests/ListConnectionsResponse.md - - docs/Models/Requests/ListSuppliersRequest.md - - docs/Models/Requests/ListSuppliersResponse.md - - docs/Models/Requests/UnlinkConnectionRequest.md - - docs/Models/Requests/UnlinkConnectionResponse.md - - docs/Models/Requests/UnlinkConnectionUpdateConnection.md - - docs/Models/Requests/UpdateCompanyRequest.md - - docs/Models/Requests/UpdateCompanyResponse.md - - docs/Models/Requests/UploadBillAttachmentRequest.md - - docs/Models/Requests/UploadBillAttachmentResponse.md - - docs/Models/Webhooks/ClientRateLimitReachedResponse.md - - docs/Models/Webhooks/ClientRateLimitReachedResponse1.md - - docs/Models/Webhooks/ClientRateLimitResetResponse.md - - docs/Models/Webhooks/ClientRateLimitResetResponse1.md - - docs/sdks/bankaccounts/README.md - - docs/sdks/billpayments/README.md - - docs/sdks/bills/README.md - - docs/sdks/codatsyncpayables/README.md - - docs/sdks/companies/README.md - - docs/sdks/companyinformation/README.md - - docs/sdks/connections/README.md - - docs/sdks/suppliers/README.md - - global.json +trackedFiles: + .gitattributes: + id: 24139dae6567 + last_write_checksum: sha1:6cf623aa5081ea7f1e32b99d74fac393718a29cf + pristine_git_object: c094dba670119a1a5414e11c713a4ea3218147cd + Codat.Sync.Payables.sln: + id: 8bc65c11b4d0 + last_write_checksum: sha1:6912bca8a880e2f5eb01851afadebfbca06f3d7c + pristine_git_object: e4a80b4dc1d008a192df8e2131f158d16bc3fbc1 + Codat/Sync/Payables/BankAccounts.cs: + id: d759eaecf476 + last_write_checksum: sha1:1d4e3918654842709199c57e14b481340910616e + pristine_git_object: 6620be5e0679a8beb99032b9e9b72fdb97161d54 + Codat/Sync/Payables/BillPayments.cs: + id: e3b36293aaba + last_write_checksum: sha1:40d1632d43de6a391d38f1f51ffbe363d38cdc1d + pristine_git_object: 57544ad518f0c20437bc62593a5656fc50511807 + Codat/Sync/Payables/Bills.cs: + id: e083f5e93c50 + last_write_checksum: sha1:f43c20f2e11aa2b6b5125076fc30844e35a8d760 + pristine_git_object: 7e98dc123e84093b4a1c8f4c62e048de65069f38 + Codat/Sync/Payables/Codat.Sync.Payables.csproj: + id: 27c2af8e86c9 + last_write_checksum: sha1:1d5e4e6b595d801ad1dc6160c26bd53782629ddf + pristine_git_object: e6d31a5187f84f9f50c9e836bf0c866c814af316 + Codat/Sync/Payables/CodatSyncPayables.cs: + id: 41ceacd335c5 + last_write_checksum: sha1:148411c35706d8823055167c1ec4bfa8b250f1e6 + pristine_git_object: f7b0c5503da9483366586abae7623db55c4a77bd + Codat/Sync/Payables/Companies.cs: + id: 326ddbb4ab90 + last_write_checksum: sha1:980a401bfb1a5dba8ad64412eee2ac6d2ccad1ca + pristine_git_object: a99d2af22423832f615e185d741afb963cb8a736 + Codat/Sync/Payables/CompanyInformation.cs: + id: bfeecd399691 + last_write_checksum: sha1:6a3eb168d5efc2d4219165c806fce227e6c3b64b + pristine_git_object: 3950ffaeab2a903b4978f99236476c615ed01e40 + Codat/Sync/Payables/Connections.cs: + id: 2b9602c659b0 + last_write_checksum: sha1:741b980d7020bc7f3c90d2ae8d105c7db04c93bb + pristine_git_object: d9402de39626e8abb58d2d18ee08dbd1e655ecef + Codat/Sync/Payables/Hooks/HookTypes.cs: + id: 1d1fbd218744 + last_write_checksum: sha1:91c874b962b507713528c9c2f22e4cdc0bba5940 + pristine_git_object: 59980e150cbbbc220ae19abfe10491db99c1e984 + Codat/Sync/Payables/Hooks/SDKHooks.cs: + id: ba72e82110f4 + last_write_checksum: sha1:d9551e3f4bf10682c016c5b343470a44ee62f548 + pristine_git_object: 87f331a1da5dee32f74f6fb2587ccda8c9b87de8 + Codat/Sync/Payables/Models/Components/AccountMappingOption.cs: + id: a2035c00766e + last_write_checksum: sha1:19a27ab42828e0303a46759ef273f5ce5221f3a4 + pristine_git_object: 214db63829bdfbc49e0be8367d63f96787a7a75e + Codat/Sync/Payables/Models/Components/AccountStatus.cs: + id: 55bfaf9dd666 + last_write_checksum: sha1:7658d84945a15c17d2fa07a19760f14c9c2f8684 + pristine_git_object: 381e22b94550eff69b0fbbc96464fd506d096e67 + Codat/Sync/Payables/Models/Components/Address.cs: + id: 275f2215d0fe + last_write_checksum: sha1:ad1da5673fe7d97e099a3ba276f592c5e6e44eaa + pristine_git_object: 0325099f4033329fcc6ed9ae0da9b4d3a6380f88 + Codat/Sync/Payables/Models/Components/AddressType.cs: + id: 38811db8f374 + last_write_checksum: sha1:935e584620955fd7da70f5636a511456f44d5630 + pristine_git_object: 7d105cc1eb8bdcaa50410de33d6b1dc84bdcd43a + Codat/Sync/Payables/Models/Components/Attachment.cs: + id: 984ae1664181 + last_write_checksum: sha1:1a1e92bc040098d3dd19ba13981f7b648ad8b535 + pristine_git_object: d6edd27e42214514a2f30c1de5dbcf7799930298 + Codat/Sync/Payables/Models/Components/AttachmentUpload.cs: + id: 1ffae559eeea + last_write_checksum: sha1:4b1375e56c8945eb73cca816885859a35f0753f6 + pristine_git_object: d8ddf20f4534fe224b29787c779a3abee1f089af + Codat/Sync/Payables/Models/Components/BankAccount.cs: + id: de3d8bf6eaf8 + last_write_checksum: sha1:8e69c60febb5528ec992964e1b5437c4fac7dee4 + pristine_git_object: eac234aa2d1fc00d75bcea068d38e340cd393df0 + Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs: + id: 84695624f3fa + last_write_checksum: sha1:28431cf5cb59be98219837932896a3971c7e8b66 + pristine_git_object: 47dc7f5edb12f7e0c94cbd58dae519f122e43664 + Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs: + id: 68ca87f661ac + last_write_checksum: sha1:49bf577b193d170f9ab24be7701c1e08b371ddf1 + pristine_git_object: 261c3390469b6506c38a5cd091a25e05f8d023e5 + Codat/Sync/Payables/Models/Components/BankAccountStatus.cs: + id: b5530f51e44b + last_write_checksum: sha1:22c5b301d668bd8c05e4cd3951edcd204279b3d3 + pristine_git_object: 00aa13702d2a1523415de4e8ad7d928f7e18e374 + Codat/Sync/Payables/Models/Components/BankAccountType.cs: + id: a3bb1d709e15 + last_write_checksum: sha1:49784454a1c847652900b1d2ce04c6bd2a9c935d + pristine_git_object: b9e49ea4aaf9ea03b32eb12ecec6cccb34e2f019 + Codat/Sync/Payables/Models/Components/Bill.cs: + id: 89072cd2206b + last_write_checksum: sha1:4918b5441eb3f8cff76cbfc0f57301f14099dd82 + pristine_git_object: 89e93c5c9ea104b2f0da713e86e251d8526a692b + Codat/Sync/Payables/Models/Components/BillAccountRef.cs: + id: 28ea21ff6f14 + last_write_checksum: sha1:1ff673b26d6cf03954d4a8549c6c6f2c8d17019e + pristine_git_object: bb2090c15176b16a8ba975324adb1592a0d96622 + Codat/Sync/Payables/Models/Components/BillLineItem.cs: + id: 7bdc06009cc6 + last_write_checksum: sha1:6cb344085750239b6b6a75d248dcfacf303c827d + pristine_git_object: 010d588c04cc539f040a679712585c3643f3cd16 + Codat/Sync/Payables/Models/Components/BillMappingOptions.cs: + id: 1bb9dbd2896d + last_write_checksum: sha1:24b5e407cf6f96eb1dffcfccc41c99eab52bbf85 + pristine_git_object: 6ad8721e05f45fe3b305487b8d5cb629d241e4e7 + Codat/Sync/Payables/Models/Components/BillPayment.cs: + id: 61e123cfc471 + last_write_checksum: sha1:fd8202b6c7bc0f069807d1a1b3f682ed27c4ecdc + pristine_git_object: 8d95c40ef5c20adde0d541e770988684c6d01ec6 + Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs: + id: e3016e469211 + last_write_checksum: sha1:8e20a6e4b4a284407943bd009b875e72e1edc188 + pristine_git_object: fa340b6ecb64d317716258b5d135944d72c38e77 + Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs: + id: 259499be6a0d + last_write_checksum: sha1:841954a4cc3a2ad43a5a8080123a09785069da7a + pristine_git_object: e3f867beae790689e230e4a18ad9fbaf23e4da18 + Codat/Sync/Payables/Models/Components/BillPrototype.cs: + id: 259026b3393f + last_write_checksum: sha1:e6663aba2f621686bf510e1e6c33c37e2e3e3127 + pristine_git_object: 42213c22f29d71e6911b0d96bfe4ed56a62d0021 + Codat/Sync/Payables/Models/Components/BillStatus.cs: + id: dafaa4452ff0 + last_write_checksum: sha1:493b399c9618655e48773b76fa709e30626f4ead + pristine_git_object: e73a650170112d7e858b1301c816c9f8d2d43836 + Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs: + id: 9e4da3ce08dd + last_write_checksum: sha1:565e64ceb8b5b49b52d95465690cec4aa2813b40 + pristine_git_object: 5a2756c758fc414a1433cc362de2c08df16637ed + Codat/Sync/Payables/Models/Components/Bills.cs: + id: 4272173c6db4 + last_write_checksum: sha1:28812c41a3bbeebc8cc5e67d4da9c937443b1661 + pristine_git_object: 9230c017809af5787b968c54f3e5fb4b3b4cf6bf + Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs: + id: 4392c6218ca1 + last_write_checksum: sha1:65edd5c262d8a26bd00123c1725e6c1fd4a8d720 + pristine_git_object: 93fb16b374f6118781fa3ae201943798218e637a + Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs: + id: ba1ec9bc2423 + last_write_checksum: sha1:0cb5bcffe80b06b95226649d7dbce50a82d2621a + pristine_git_object: 7ae2d02dfc17481b2d6ffe77414420fa0ea30c67 + Codat/Sync/Payables/Models/Components/CodatFile.cs: + id: d4293dff5564 + last_write_checksum: sha1:e48786cc583c733de7099763ded56f5d59b811c2 + pristine_git_object: 3904e5b472df59f9fc0362de34d656fb7ca8afa2 + Codat/Sync/Payables/Models/Components/Companies.cs: + id: "120001158414" + last_write_checksum: sha1:974d5dd04f70b4a06e6f59dd119f85f211bf26bf + pristine_git_object: ef8f2dce0d05b5fdcd5977f6991a69c99c88c4f4 + Codat/Sync/Payables/Models/Components/Company.cs: + id: df957ec120d6 + last_write_checksum: sha1:f53c2f84deefbb4a1d45ad05275774c47663a4cd + pristine_git_object: baecfff532fe7a72eac4aed2b68ef9be724ce7ab + Codat/Sync/Payables/Models/Components/CompanyInformation.cs: + id: 591353cf71af + last_write_checksum: sha1:fc115f1dac551d4644ce74b8576a54606088363e + pristine_git_object: 33c300797680d1d1b9415a3f9f4626675b6b1b9d + Codat/Sync/Payables/Models/Components/CompanyReference.cs: + id: 2875d241fc2f + last_write_checksum: sha1:24871d33ba0eb226b8819cb81b1a08027eb2b63b + pristine_git_object: 9bd813b3c188c583455525619519b94abe7cce12 + Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs: + id: e804d69f9552 + last_write_checksum: sha1:a54a52d1ddf839859e0510c0bad15ceeda9a9957 + pristine_git_object: 0b7c6feba1653304a38578c7915f391f057b7f56 + Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs: + id: 055c4d487b8b + last_write_checksum: sha1:c1c33b0a404fbfc89616c4edd302e17bf9a761a9 + pristine_git_object: 072912778922a20529fa112192b389c96f4e6075 + Codat/Sync/Payables/Models/Components/CompanyUpdateRequest.cs: + id: 2c0dad8ea349 + last_write_checksum: sha1:8722afb93b3aa556b6c2f2507f12e49f2b027123 + pristine_git_object: b3602add10426e59d5dcdc6d567ee1483ef1a8f2 + Codat/Sync/Payables/Models/Components/Connection.cs: + id: 17979458ec28 + last_write_checksum: sha1:1090f558787d33b4f22e17cc2ff5b8e8c8f2062b + pristine_git_object: 94b8aadc282a9726e1ef845ad5b0cb62aeec7814 + Codat/Sync/Payables/Models/Components/Connections.cs: + id: f6f85bee383d + last_write_checksum: sha1:0e79ce89abb5994efe288ceb66257c338c4ead71 + pristine_git_object: 034beb101d47e9e8e5b36e5b9c4ac8b8d49e5716 + Codat/Sync/Payables/Models/Components/DataConnectionError.cs: + id: 2fa181fa7f41 + last_write_checksum: sha1:689e41339dc698918fa54036263ff9776c8cf3e8 + pristine_git_object: 8ded5105324f90c2c7d9151cbc56753dc7585425 + Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs: + id: f2134a74c927 + last_write_checksum: sha1:22c84c4659ba326826e64b64bcfecc050836ad1b + pristine_git_object: 43ee3e03d13a64aee013e102d1a113e907433d22 + Codat/Sync/Payables/Models/Components/DataType.cs: + id: 03ea8c497a95 + last_write_checksum: sha1:3e0fc34315c6f8899bab5ddfea8d5011166834e9 + pristine_git_object: adff43f1f1e2ac45f59181df9c20a8d00a234708 + Codat/Sync/Payables/Models/Components/ErrorStatus.cs: + id: ad708a358eaf + last_write_checksum: sha1:7a2064fe7bc3a813e93554405359ab72806f6ab5 + pristine_git_object: edc3e7691e0f04b70d0fa8c31e9cb0cb372e72ef + Codat/Sync/Payables/Models/Components/ErrorValidation.cs: + id: 0ab25762d19b + last_write_checksum: sha1:716e5ae98c6154b639993403d63fbe2952caf7c2 + pristine_git_object: ac95111c31e3415096eaf992944532dc92a3684f + Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs: + id: 983c3d64e759 + last_write_checksum: sha1:d554b2edc02f7cccecec726acebc59a3eb4d855f + pristine_git_object: a375891c3922b37d73d1e4f761406c335cd82ab3 + Codat/Sync/Payables/Models/Components/HalRef.cs: + id: 943add32b63d + last_write_checksum: sha1:666de1066bf5398fefe3affccc2ddc196c9ebb41 + pristine_git_object: 17a6f0c66af20582b0cc0de1249209a16991bcd6 + Codat/Sync/Payables/Models/Components/Links.cs: + id: 942ae965d8c1 + last_write_checksum: sha1:1f7ab5ce59b28b7d966f90145e166bb2b2d384b1 + pristine_git_object: e0b9c428d356d927ec44ec76a84bc85e9f29c11d + Codat/Sync/Payables/Models/Components/Pagination.cs: + id: 0a1607c922a5 + last_write_checksum: sha1:40f3fd8725b7df9ba50aa9682b30d36432d65dda + pristine_git_object: 06f3589c4d759120465669132ca71058a1f2dbc7 + Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs: + id: a833c427dff8 + last_write_checksum: sha1:a7975a9144dff292cf2fe972323196fc9d964cbd + pristine_git_object: 34cfdfc0398069f9dc70938a21fc6f30ae8d8074 + Codat/Sync/Payables/Models/Components/Security.cs: + id: c18befcc9acf + last_write_checksum: sha1:a0e00d4e7ee808bfe91393a0a2fb0698251cb91d + pristine_git_object: a593417b457ce2b4e63d0b03a4dd2c1ad0ceb241 + Codat/Sync/Payables/Models/Components/SourceType.cs: + id: 68e5ea353d10 + last_write_checksum: sha1:909711431bd46d22889b944e9e3413703e9f3a70 + pristine_git_object: 5a51c7769f2c48f1518421a0ccd679d93be90564 + Codat/Sync/Payables/Models/Components/Supplier.cs: + id: 686b572cab07 + last_write_checksum: sha1:2ed220efd1bcad289297f74268a78106792822c1 + pristine_git_object: fc9c61314b093c6e21b909084caeae1672d71d54 + Codat/Sync/Payables/Models/Components/SupplierPrototype.cs: + id: cd8dac0b5b5e + last_write_checksum: sha1:392e192c4d35c286fd163cdd5460d22cccba7661 + pristine_git_object: 37c9ddc389e9280cc88be752296e7dc929ecd509 + Codat/Sync/Payables/Models/Components/SupplierRef.cs: + id: 35415c5ece02 + last_write_checksum: sha1:a1cc0f8a1ff9df87f1e63e2c5e0f1cbcf47449fc + pristine_git_object: fae913e8fe181c7975ed3b797e1bc73201f766e9 + Codat/Sync/Payables/Models/Components/SupplierStatus.cs: + id: dd89993f55ad + last_write_checksum: sha1:8b7e9d72d691f7ce108b73b225756718bc6918f1 + pristine_git_object: 2067fda98106ee27fb16362593ba3ef647b16b16 + Codat/Sync/Payables/Models/Components/Suppliers.cs: + id: a4df5788207c + last_write_checksum: sha1:1374092884d5f3eba62ae48cbe16d227b7494fba + pristine_git_object: da91a741c587a9c3f761b1b9ee6411dad5ab542b + Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs: + id: 03534324026e + last_write_checksum: sha1:1f2bc46654a75bd4ba18db32e9e605d2802678b3 + pristine_git_object: a04fb5fae469d2694bceccdb08337098d8fb1e0d + Codat/Sync/Payables/Models/Components/TaxRateStatus.cs: + id: 9bf642e8a1fd + last_write_checksum: sha1:31136e3c52bd9cc00c218fe2d30cb1f502c64cc7 + pristine_git_object: 99db1749bf62ba546368d0d071607b2efa429ac0 + Codat/Sync/Payables/Models/Components/TrackingRef.cs: + id: 128cd17d85ea + last_write_checksum: sha1:fb4d8ee8165b76746d1da27476ebdb2932e69569 + pristine_git_object: 73e954ff069885bff5ce05feda0b7e87c5786bcd + Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs: + id: aeafcbf03d34 + last_write_checksum: sha1:b40ab6ea9d4fb19f62d52c34ba3bd75a4ffa37c9 + pristine_git_object: d1a1881aef1439358c91aa52bdb84b30561bbaeb + Codat/Sync/Payables/Models/Errors/ErrorMessage.cs: + id: b2b27b44f1b2 + last_write_checksum: sha1:93dd6f835634b970bf10f7baf5d1099bc28e102d + pristine_git_object: 2aeef89b4dabbced804b96ccbc6256518aaf6065 + Codat/Sync/Payables/Models/Errors/ResponseValidationException.cs: + id: 17f210a91806 + last_write_checksum: sha1:0e641b9164c0a6238b6c20f13ccea1050102ccd3 + pristine_git_object: c0c570f6ef7c70e24080d5e471298fd6fb494326 + Codat/Sync/Payables/Models/Errors/SDKException.cs: + id: 2640894425d5 + last_write_checksum: sha1:cf8a558ba4918243597cb46c44709ecf783dc180 + pristine_git_object: e5c1e3d9b66ddcdbbad71d3ff9b13dd146aaa63b + Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs: + id: 0e2420237d19 + last_write_checksum: sha1:caa3c78563377792ac8b64eb3d8a68eafae72ebf + pristine_git_object: 78d5d0836782aa734ceac00dd4dc6b04bcc5687e + Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs: + id: f169371720ad + last_write_checksum: sha1:1b0017a2048c64b3f19f9485e00c204f69867f56 + pristine_git_object: ebfd1fc4ab83741ac848ebdc5595d7d0a3587f4e + Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs: + id: c3d74d5b3220 + last_write_checksum: sha1:1b35909c27cbafc0493a046bdf5b45c671891dad + pristine_git_object: e75f00e992ece7110e47bd71b13cb65f66459999 + Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs: + id: e186275a530e + last_write_checksum: sha1:593126a60cd905709d8502577cf9690a9356f459 + pristine_git_object: 2b591743b3294aabab2289f1eb33ff1413236c31 + Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs: + id: 5e7faeb9da76 + last_write_checksum: sha1:3b53d6d3ff5dd1cdbfc939204e88b3edaf43b784 + pristine_git_object: ee8e80db2c2c3501cd654ac0ae964c0e944ec690 + Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs: + id: cc843781f0b4 + last_write_checksum: sha1:545170b40346af4d74b0757d5b01b9faac15343b + pristine_git_object: b8f9e3fbbabc2e1f75483cd3cd0600d950cc6ede + Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs: + id: 5e3c04ba602e + last_write_checksum: sha1:0a169e0395b67964046d5069ff867810b5a59fb7 + pristine_git_object: 1e07cbf7e22100b53c6b814b71eaa846fa055ef4 + Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs: + id: e004f5bfdeed + last_write_checksum: sha1:aa548c59c873f625e28ef3dac64c85115b68272b + pristine_git_object: ee2807dab98491fb3f0a26dc63e5d13927109c4c + Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs: + id: 66268c03973a + last_write_checksum: sha1:d7575cc6ccd65f53b3095ffadc655e6ba6b4fe11 + pristine_git_object: 1bbae574b87f5e22eebfb59690ae4cb150e7564f + Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs: + id: 1deeae3542c5 + last_write_checksum: sha1:c3e3508458d078655a37cffcfdb973035c929947 + pristine_git_object: 49bde8f5f17259a179064c0fb0f09ab2f8421797 + Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs: + id: 3d19b78e6236 + last_write_checksum: sha1:5ff0f994a7733a5825bb61cd2c451d90bd82b77e + pristine_git_object: 8c024b1975822582efce3e5acc913437dc11787f + Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs: + id: 1d16bafcaccd + last_write_checksum: sha1:efed004dbadfddfc9c74310512771a61aab94232 + pristine_git_object: 1fcc8c857d90ca011dcd9a145b05b70905be976c + Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs: + id: c071502380bb + last_write_checksum: sha1:d3791a12f5f3f5d0c6b13cb2c3191589b4a9b7a3 + pristine_git_object: f1aff709e06abb6d347673cc512bb2a710f74ccc + Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs: + id: a53804f508c5 + last_write_checksum: sha1:e3087a3b6bfdfd2c3c44d4d7b3e74cd7ff769829 + pristine_git_object: 7a9f703bd1914ac073a4dba1ba55344c37b636fc + Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs: + id: a8fbe6ba76d1 + last_write_checksum: sha1:f5e96e3dfe49a747ab595af6e9bf8d1a67065b92 + pristine_git_object: 63de094c1c7b5709fa32c3f1e9afd161b7077c9b + Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs: + id: 76658b2d8bea + last_write_checksum: sha1:5a17adf1a2b4f4709fda91b51fb83a0e0803f186 + pristine_git_object: e94108f9c2e59433e4581e6909cbf11a79034351 + Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs: + id: 32e2c880e5e2 + last_write_checksum: sha1:41f323266111a285c14621ac77eb41abcc5e4d1b + pristine_git_object: b302d3c9a6d51f66f53a520429156b4312453472 + Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs: + id: d2c9bb290d25 + last_write_checksum: sha1:a6131239e8308b1d7d9971b75410632eef556d8b + pristine_git_object: a4f910ff7183e9507aae98f6341cdcf2276d914e + Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs: + id: 6feee1be369f + last_write_checksum: sha1:60c58651af31aeb7bdd0e3eaad5a0411d491530f + pristine_git_object: a76045a22abb921319a92a7a2a78ba1755931d68 + Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs: + id: 003d088cdff3 + last_write_checksum: sha1:455a5ce6a3a3fd9002361e34e7df2d57c26e5a86 + pristine_git_object: 81778afe62524394caa4e265f44427c4d578db86 + Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs: + id: 323ae337f48d + last_write_checksum: sha1:c828ecde9395a11e8ac064a1814e775795544563 + pristine_git_object: b90933e05720686440318e6b551ed4c3d208c803 + Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs: + id: 930aa2718c7d + last_write_checksum: sha1:9f67724e50848159e3ab8ee8864c5bc3697cce5c + pristine_git_object: 9898592333682c99ee2effe9865e970a3c39a36a + Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs: + id: e45cd25c85ca + last_write_checksum: sha1:8eb4f76af6baa0e0283b35a28cc333b1cc77a3f8 + pristine_git_object: 10c389d64b74262aacbd9caf1bd277b7aa2c4424 + Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs: + id: c686fd4f4339 + last_write_checksum: sha1:bc054a4037cd22c397ff08b82cdad798b6ee789a + pristine_git_object: 7b2791bdd6d37c27c0cba8fc48b06dc53fbd0591 + Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs: + id: 5d344ae3a395 + last_write_checksum: sha1:5d64d913fd6fca44945cd401575e3db3c4f1f370 + pristine_git_object: 84c8235c244abc9bb5b8a46476b5b0f7bddbf7f3 + Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs: + id: 1591bf3425f2 + last_write_checksum: sha1:a3b1312ab6432d9376d46a726fc64d735008df99 + pristine_git_object: ef907195052d6ca323e77da96e09128b8f685081 + Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs: + id: 938d277b633e + last_write_checksum: sha1:e978b1d320d0888c5000c342de86b8fa2fe0c613 + pristine_git_object: 2f3ee441ed360ca6c0ed9dc815634117c985ac39 + Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs: + id: cea629b60ef8 + last_write_checksum: sha1:e411484117d07b5d2cf9b6b66706a427fc814dca + pristine_git_object: a76a75dea450c54c8ffc0603af146f4ecd64ed79 + Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs: + id: 13e40dedb558 + last_write_checksum: sha1:a4bcec0069a58dadf0351407666a211afa003232 + pristine_git_object: fb7d079bc1665d48bd017cdcea234eeabd85aa5f + Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs: + id: d43efb331fd2 + last_write_checksum: sha1:79179e27d1f7ac641061d9d038e6504800384693 + pristine_git_object: 36cb1453f99d8124a412f24268ece92ebb71b572 + Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs: + id: f0d431f16347 + last_write_checksum: sha1:0862203fc04895e35f611a5e1b04cf2e151f2a27 + pristine_git_object: 4ae146042a1ee2fa2017551ba9f309b64edfcd5e + Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs: + id: 0034600080a0 + last_write_checksum: sha1:c1fc561810e52f03dc870efae4137ddfe034920c + pristine_git_object: e5d6a5ccceb52ed08cc20966a8103bf19913d3b0 + Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs: + id: 897c7bd8f03b + last_write_checksum: sha1:5ee08b9fd9937932dd0bb1f607af173e0b0ea736 + pristine_git_object: 4d07d3027cb74b721e16e4be6d9c2c3ef25c0c4f + Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs: + id: 46236dcc0212 + last_write_checksum: sha1:4fb1b504deeab721823dfd554f9b84c93db9daa5 + pristine_git_object: e77ce184b96c48e7996778ac4bcfef2a353715bf + Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs: + id: 4fc79687ea76 + last_write_checksum: sha1:c2a0e27b8c0050685917c1c1b5626ed02ce4e369 + pristine_git_object: 35358c7fc38cf96661806691f8083ac3f43c2ccb + Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs: + id: f25768bf38bf + last_write_checksum: sha1:bed92c964ba870dd8479925685e99126e8afd2e3 + pristine_git_object: 602fcee93abbe84f25962cdddca1836cb6a7556e + Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs: + id: af482848b542 + last_write_checksum: sha1:6fb28ba4201a44ff9cc63b5b68797803c8dfcd19 + pristine_git_object: 2a6ad8d2abfc313614a5f34a03de25a84df8ba43 + Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs: + id: b953ff298b54 + last_write_checksum: sha1:6aa7070872eac9f5ba7a44ea5e7b28a292faac5e + pristine_git_object: 9bb7c33348e1093b0fa2d0f845317f1b0b369ed6 + Codat/Sync/Payables/Models/Requests/ReplaceCompanyRequest.cs: + id: 1e644837085d + last_write_checksum: sha1:755f000c0498702eb9cee81d2bc6808c9cfa78d3 + pristine_git_object: e20d96594f13147e901d0a9a8b9c333f3ce377f6 + Codat/Sync/Payables/Models/Requests/ReplaceCompanyResponse.cs: + id: 34f87ddc97de + last_write_checksum: sha1:3d40445ad5bdb92e73b43c90c7e5b052b62257aa + pristine_git_object: cb5f0c9da554590ac7980f033f17883b1b29aa8a + Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs: + id: 081712a57cfe + last_write_checksum: sha1:243062718ced3c75f013b30434a81a6425e55755 + pristine_git_object: 22bccf88486fca525295bb66d46837d84dbdce14 + Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs: + id: 86efed71ca3f + last_write_checksum: sha1:a02d38dd84b6cfe47eb61036c427bbed1e48bf79 + pristine_git_object: b6140adae62678c4d4ff15fa50b675344b23e0b8 + Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs: + id: 3603d725ff50 + last_write_checksum: sha1:cc5c04ad9066c1e6505f9baa8930bca131ed7b94 + pristine_git_object: f88f479ca10ed640486e0455e57bfb383c630446 + Codat/Sync/Payables/Models/Requests/UpdateBillRequest.cs: + id: 789db5ca64bd + last_write_checksum: sha1:a2f4bfea88590f5c2e652c3d3a125903b4d8010b + pristine_git_object: a92bc49d5b2fe05342d40692b1c8eccd1ed9185d + Codat/Sync/Payables/Models/Requests/UpdateBillResponse.cs: + id: 2e3e466361c3 + last_write_checksum: sha1:79b0b08190116984625015cece3e644fd6595961 + pristine_git_object: 3eb163711dbfbfa7f769883e6c15b1cd308fa6cb + Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs: + id: 89f5f8528743 + last_write_checksum: sha1:c97a35cf4c050cb7a4af4caea07de8d1d8c555c8 + pristine_git_object: 609169e1a756b11bb96f250b6079888b3d84111b + Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs: + id: 878ed4d6fd8a + last_write_checksum: sha1:caa89444729bb095acb8073b52af8171aad72c16 + pristine_git_object: 08c1c63aa8dcefa920c57bab1337d0c68a29e289 + Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs: + id: ca4d0625f87d + last_write_checksum: sha1:634e3a104bd936d3ffb3c997827fb80918668def + pristine_git_object: 91989241560a302261fc304a5127772be830091c + Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs: + id: 6c19704ce11d + last_write_checksum: sha1:349367062875a52480e723143d6fed6aacf27a66 + pristine_git_object: 838b8b587fa7fcfba5b7f7263ea019f83885d20b + Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs: + id: 404f1f79a11f + last_write_checksum: sha1:d9adb938751385507eacf511f42323d08842a2b0 + pristine_git_object: 791d143e53c95ef2dae72a3da8062b2c5811d1be + Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs: + id: 14ea65dabbfa + last_write_checksum: sha1:3c63077c16ccc509e21e00431368921f32276a56 + pristine_git_object: 1eb9db1274e988187f1ab67a90110461e8d5d349 + Codat/Sync/Payables/SDKConfig.cs: + id: 9a9d58bae336 + last_write_checksum: sha1:bad336f78d21103ecf75bbcab5807d2eeb9a5f0e + pristine_git_object: 943101aead9db02749061d5c95018ac026ae299c + Codat/Sync/Payables/Suppliers.cs: + id: dc6d700dd058 + last_write_checksum: sha1:86310ad245d55d00cc3c4f03c7e99e957967cc67 + pristine_git_object: 748840ba00883c703abbb5bfbdac7630fd677f99 + Codat/Sync/Payables/Utils/AnyDeserializer.cs: + id: 6154a3501f3a + last_write_checksum: sha1:42fe4f7c0880b9bdf2632a2f81da67238964243c + pristine_git_object: 0a7697ce25d8d75589f33d9720819475002bd29d + Codat/Sync/Payables/Utils/BigIntStrConverter.cs: + id: b5c151d27338 + last_write_checksum: sha1:8743c217a205fd855a83830779ad2e04d985ab60 + pristine_git_object: 19c8f4a154f7882ea81ca6c8d1effa78b5009852 + Codat/Sync/Payables/Utils/Constants.cs: + id: 26a6c908c9c7 + last_write_checksum: sha1:7f03e8e8b8e38b0a6d531f70ee045ea2da9c8f24 + pristine_git_object: 9cb4ab96e84989265ff6e89af667a12b65040ce4 + Codat/Sync/Payables/Utils/DecimalStrConverter.cs: + id: 732482e82206 + last_write_checksum: sha1:6d3efc9c8e2de4ee867f7ab85fd86d6825812d83 + pristine_git_object: 03f3a5318a054677f6b28139145fb5936b1f71be + Codat/Sync/Payables/Utils/EnumConverter.cs: + id: 9851e63b97fe + last_write_checksum: sha1:0b3b53f34b81ed5fcbc4a2af97bf1dbcb0d0883d + pristine_git_object: 15c373f713261c60a5326dc7bb4c0955985a9954 + Codat/Sync/Payables/Utils/FlexibleObjectDeserializer.cs: + id: 38cedff0908d + last_write_checksum: sha1:3abb1d72ef8bdf9721258411129e54755cf04c37 + pristine_git_object: b8511e5354426b4830c63360dc03a9ead4189ea8 + Codat/Sync/Payables/Utils/HeaderSerializer.cs: + id: 701abff065b2 + last_write_checksum: sha1:e7bd8914c6dbd2f1bc653d19bb24b468f027cd99 + pristine_git_object: a4d460f1b4c7d907db9a4341bdda7e3f21d0564b + Codat/Sync/Payables/Utils/IsoDateTimeSerializer.cs: + id: cff2a584869f + last_write_checksum: sha1:92432e426ca88b74f16d14845e29311f8ccef231 + pristine_git_object: 258f19c4279f3913efaaf7d075b8409105599041 + Codat/Sync/Payables/Utils/OpenEnumConverter.cs: + id: ec5eaffc51b8 + last_write_checksum: sha1:52b0267b94a885f3dd9a4c05c56e52a451957f27 + pristine_git_object: 48486dcc9715da2b1a1e4e9217b9b2c186699a5c + Codat/Sync/Payables/Utils/RequestBodySerializer.cs: + id: be7bbb8d329d + last_write_checksum: sha1:86ff3982d6b0412b04799e06fcb67351c96bc54f + pristine_git_object: aeed4914af0c130ec1184339c5712a0bdf02fffa + Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs: + id: e562493b0e77 + last_write_checksum: sha1:1392b496914ae6e5db4f7eb8aa12df82006f725d + pristine_git_object: 39876eda8123c6ee292de2d9c5dfbda8d306c136 + Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs: + id: e2814204d17c + last_write_checksum: sha1:92464cc0d1e21abc9bcf767c92f4ff14c8746c92 + pristine_git_object: 89a56678a9bb263c33c24461d3541ef2f1808cf6 + Codat/Sync/Payables/Utils/Retries/Retries.cs: + id: 4c3cf6b5e847 + last_write_checksum: sha1:92e9c715d45fbda094f4c1e919d0d78209cb9c4e + pristine_git_object: eb8331889085c079961e2dd3a6c8c4211c70ae24 + Codat/Sync/Payables/Utils/Retries/RetryConfig.cs: + id: f420b749e187 + last_write_checksum: sha1:6137595ed58bd47500ed6ff5e74cbef2957ff782 + pristine_git_object: 21794a32d6c11021a5d7e77eaffe958cfdfd2b21 + Codat/Sync/Payables/Utils/SecurityMetadata.cs: + id: bca126653bce + last_write_checksum: sha1:6a7bf390eb9d9acbe215eb5078297f9d447ecca0 + pristine_git_object: f57cd9776ce65e31e9b881f766c83c2ce8562054 + Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs: + id: bdf2a26940c2 + last_write_checksum: sha1:5f51f3813bdf8357b3283a9994d48f81ca5c0a00 + pristine_git_object: 5c3627ef8b4fd3f7968e58a0439ef77786ef4ec1 + Codat/Sync/Payables/Utils/SpeakeasyMetadata.cs: + id: 74f102705004 + last_write_checksum: sha1:93f23841e559c8b476f68662de430fc8d404c5eb + pristine_git_object: 5da622cd6da7b87051e5903645f7908e08361ece + Codat/Sync/Payables/Utils/URLBuilder.cs: + id: f0d6a4e95df6 + last_write_checksum: sha1:a1918dc5b4e311c3b733a7403e1d9781e401c758 + pristine_git_object: 436e7620fac8fac7c9bda994768437456ad4a1e2 + Codat/Sync/Payables/Utils/Utilities.cs: + id: 5491ebcd861c + last_write_checksum: sha1:198b3e68375a1f43471863dda5cdf6cb9dce2dc4 + pristine_git_object: f83b9d08bdfe7668bfce090fd014a4cab7f9ece1 + NUGET.md: + id: f4c8a442a6e5 + last_write_checksum: sha1:112ef1aeb54f1a69730a5a7acc36a2ed2bf7b91c + pristine_git_object: d41b44b32026e839ebfc9931c840c8ef40cde7dd + USAGE.md: + id: 3aed33ce6e6f + last_write_checksum: sha1:b4c74e210215313e1be434c0c3ed8cb2956079ac + pristine_git_object: 6e49064f2b0a7bf99381aed10940b76884be0414 + docs/Models/Components/AccountMappingOption.md: + id: 98c1a939735c + last_write_checksum: sha1:bc2e6dccb799b0b79be4a6562901b7d4d4f30a99 + pristine_git_object: 24fae66145f73465c904366f5ea80f2c06dbe99d + docs/Models/Components/AccountStatus.md: + id: e56505065ab2 + last_write_checksum: sha1:e7f7510368dd4bddf3d900b279c88bb3290dfeb1 + pristine_git_object: 46619626a5e6e91095b83025c5c33354bf824651 + docs/Models/Components/Address.md: + id: de24ea0d518d + last_write_checksum: sha1:7d6fa16c554125ee122ba9ca5823779ea965cac1 + pristine_git_object: 51abe05a9b7a013afefc85a26d88da4193d2299d + docs/Models/Components/AddressType.md: + id: 2ce77b364191 + last_write_checksum: sha1:be47293e227b1e808067b23126c1c9964f744fbb + pristine_git_object: 00e042679b10efc7581db359ca7b5c13a300e51d + docs/Models/Components/Attachment.md: + id: df237b715365 + last_write_checksum: sha1:ba6918300dfb47f4f65e9d98601b2c687c4a544c + pristine_git_object: 5661cc91357253ba10116172899883031767fa8a + docs/Models/Components/AttachmentUpload.md: + id: 23332d819ce0 + last_write_checksum: sha1:5c8d5315005bffabc16e5b97f50e10057d28b53a + pristine_git_object: ce2b64654de55fb1b14fe8ead338aa9212724db2 + docs/Models/Components/BankAccount.md: + id: f63219418217 + last_write_checksum: sha1:05abbf8b8a22406ee810af9a99e1b6122e083ef5 + pristine_git_object: 5d162a4f660571c7d8e5bc77392aa4b01201262d + docs/Models/Components/BankAccountMappingOption.md: + id: e3761ee0ba18 + last_write_checksum: sha1:dad3bdab20174372756ab35add578528c08db76e + pristine_git_object: c11ec369c2135ced55a148cad694add1d2680eea + docs/Models/Components/BankAccountPrototype.md: + id: 8cf7078c92b3 + last_write_checksum: sha1:982bd5fe2d2041c4a9f0a4d74e8779f3137d6258 + pristine_git_object: 7a7adef9c94f2f11eb3fc722be846b2c72c7f0e1 + docs/Models/Components/BankAccountStatus.md: + id: 2e04c2652cc7 + last_write_checksum: sha1:aa2d9cee73884f8f017f24f750aaa6a6ea2e3d3a + pristine_git_object: 565acbf37bb64a80291233bc9ad964e55dea151c + docs/Models/Components/BankAccountType.md: + id: 0560e30f7d5f + last_write_checksum: sha1:9f3be767d9bebe03856cb55324cfc63304c0dae1 + pristine_git_object: 422338c051e74907c712c41894dbb07a20065114 + docs/Models/Components/Bill.md: + id: b0a5cd527ff0 + last_write_checksum: sha1:d86f196592d20847d50396a7c95f8fddd58fe6a1 + pristine_git_object: 1626ea1dcae1e28f0da87e016e3e0795b1bf699b + docs/Models/Components/BillAccountRef.md: + id: 4677015e59a9 + last_write_checksum: sha1:fddd4444394c08f523f2166d5eb53dcecd9e2586 + pristine_git_object: 194b7819529eb42834fa2553a29df28d41ee81c9 + docs/Models/Components/BillLineItem.md: + id: c9b2b830a535 + last_write_checksum: sha1:943a81b521417c5a71d93b7bfd1ee0bfddf0b320 + pristine_git_object: e8d3415e306de2a441c61660b67ed4fb6296fa98 + docs/Models/Components/BillMappingOptions.md: + id: 2ca3466d0d92 + last_write_checksum: sha1:9b164cfed913347b2afbc3685ca90108a5629040 + pristine_git_object: 44b487652facccc67b9278558890b0dc82b022cc + docs/Models/Components/BillPayment.md: + id: 79581bddd734 + last_write_checksum: sha1:4dc34bdf328819ce87b3ab4df0f2768f8f823955 + pristine_git_object: 5f70c40235eb0d1de84b117ee8b71be1b10967a2 + docs/Models/Components/BillPaymentAccountRef.md: + id: b38c0f9670cd + last_write_checksum: sha1:9c5a51758159a9c9db90e1b5dc57b8dd62ad57fb + pristine_git_object: 776e28bc47bffeaf9c75e3d055babbe0190a2a7d + docs/Models/Components/BillPaymentPrototype.md: + id: 1c3f03c4a12d + last_write_checksum: sha1:83c3dd5328f7401c467d8c52f82e1dead48dd823 + pristine_git_object: f1153d59f9b8da8299897547b187b7cfd2491a7f + docs/Models/Components/BillPrototype.md: + id: 803612ab2e6d + last_write_checksum: sha1:0e150e85f62036cffd393c2a3ffedda8a393a89f + pristine_git_object: 6700edd61d7fe105cbb549c289e531b9b1febf28 + docs/Models/Components/BillStatus.md: + id: 43d9eb047117 + last_write_checksum: sha1:aa54cff8d41c38921e0b5b99653b0233f9a11157 + pristine_git_object: 1ffbeca0563a987a7380c3e2d302a5c3232425be + docs/Models/Components/BillTaxRateRef.md: + id: 44ef8016bf64 + last_write_checksum: sha1:0a765c7c98df80d34e709ca8b1376be4818dd350 + pristine_git_object: c1695492e3503054348753d5549fdb0f0431baa5 + docs/Models/Components/Bills.md: + id: 0283d8661c72 + last_write_checksum: sha1:414d8b0e0b9a76d02eebdae3ad2bc1125507a5f5 + pristine_git_object: f66ba2a2e562160b8bc8590a3127bd28e6ca87f8 + docs/Models/Components/ClientRateLimitWebhook.md: + id: 76c3a2ac70a1 + last_write_checksum: sha1:2484e6e6a26741193199400c161723f5c372ce4c + pristine_git_object: b5ded115e678cd1fba759ce350b25c66bad90f26 + docs/Models/Components/ClientRateLimitWebhookPayload.md: + id: 56e0e7798a5e + last_write_checksum: sha1:1a7795dd1007642791299f3ec78d349d1ebb47ec + pristine_git_object: ba85388946a28ad7793134a481f5ae3cd7896f3d + docs/Models/Components/CodatFile.md: + id: 0cca107479b0 + last_write_checksum: sha1:e6c646213692731f42360190fa282d4eb84e6861 + pristine_git_object: 21a4956c29ce17027ce75d35d0e950907112b77f + docs/Models/Components/Companies.md: + id: 246c1946d2f7 + last_write_checksum: sha1:6767cd36f46b34a075db4da70d4bfc8a540a4ecf + pristine_git_object: 8aacbd8d53cd9a85ac67035a6c6eeff3cfd9eddb + docs/Models/Components/Company.md: + id: 4827695a19b4 + last_write_checksum: sha1:0ea2d9885ae4e0bc8d469e1b68a69b02ef3c29de + pristine_git_object: 038238510e783ab3c1d0a7d5ca127bc0cb29cbac + docs/Models/Components/CompanyInformation.md: + id: 046f1da41902 + last_write_checksum: sha1:64f0330219bd1b62423320ccb1618dc87c6c05cb + pristine_git_object: e0562cf3b5182ade0096513c05eaf989b196111c + docs/Models/Components/CompanyReference.md: + id: 7e01a182a597 + last_write_checksum: sha1:d8d4c91b6a53b56c9f5e2f5870d5f67c948b0409 + pristine_git_object: e1795c96792a675687fc583f9eb848d51ec4c24f + docs/Models/Components/CompanyReferenceLinks.md: + id: 64c32b92b754 + last_write_checksum: sha1:4dd0733752e32a5e740d6036d40df386e4329e82 + pristine_git_object: bbabdd5293c37d951b3557d0029a5c5a92d4666b + docs/Models/Components/CompanyRequestBody.md: + id: 442daaa3841e + last_write_checksum: sha1:c9efd43219c61b60c8787e0f5a1fb59d3f13e868 + pristine_git_object: 11705efb355c106127797a13170b01cea15140a6 + docs/Models/Components/CompanyUpdateRequest.md: + id: a56f577b7dd1 + last_write_checksum: sha1:04fb553b98adc9c012c4316827ad8b9bbb165f3d + pristine_git_object: 2e5fa23d7bb058f3ae24ddb1dd16b618858575c2 + docs/Models/Components/Connection.md: + id: 5688c7e8f7e9 + last_write_checksum: sha1:7f091061eed231048f880246972f5ed712f10d87 + pristine_git_object: c62e9746443117fb7cc425967dc78bf04b499d7e + docs/Models/Components/Connections.md: + id: f7e1a57da8a7 + last_write_checksum: sha1:e112155362b0d07c0fc76f7e0f7db1e0e6d5bf6e + pristine_git_object: dfabbaca541835f4199581aa6f11e493992bf45f + docs/Models/Components/DataConnectionError.md: + id: 5dd8d2166aa9 + last_write_checksum: sha1:b4d88a730a6e98e92763c87ed51620b1eeaf45ae + pristine_git_object: 2e7779da343adc3bcde777c9dacc76734a8f223c + docs/Models/Components/DataConnectionStatus.md: + id: 100db3cb3431 + last_write_checksum: sha1:b4fe05d43957d052510e1a5e916e25bc0175116a + pristine_git_object: 5d13bea516133003653398aacc1e9b963339249f + docs/Models/Components/DataType.md: + id: ea9ccd5a7c4d + last_write_checksum: sha1:6bb25f64acea6f77e3df6a0726f750d09e9a8a98 + pristine_git_object: f20ceb8d2b4969ba60c0f88d1677e1efe00cc8d6 + docs/Models/Components/ErrorStatus.md: + id: 8de8545283c4 + last_write_checksum: sha1:54db65bad80e1edaecafa188d720645ba04cf00a + pristine_git_object: 9dc6625538bc288b5d0290e56d43ef5d84b0e676 + docs/Models/Components/ErrorValidation.md: + id: b9d95ce89516 + last_write_checksum: sha1:677582395d374eef93c9fab9ec1e069e6bdc1530 + pristine_git_object: 9d49d6fa622a06fa65c156bfdc58a5fc50e32361 + docs/Models/Components/ErrorValidationItem.md: + id: cdf407a86027 + last_write_checksum: sha1:726fb6472066f59a3bcbac265430235499e100ae + pristine_git_object: 6e0b6e5e3945b1fa7ad710c2b30d977332e20abe + docs/Models/Components/HalRef.md: + id: 4ef57d2f8806 + last_write_checksum: sha1:e939b73619984d87dd17850152acb1df5ec0e313 + pristine_git_object: ca171430470c4cefd9b63ff1872f9d4e02c6f083 + docs/Models/Components/Links.md: + id: 96c82369ab69 + last_write_checksum: sha1:ca26d2590a5ec377cb1479f96f392963c8b32c59 + pristine_git_object: 0f1008779ac0f290bde00fcd4be663fa0c4753b6 + docs/Models/Components/Pagination.md: + id: 1e1f649abd7f + last_write_checksum: sha1:c1cc34e0508fe63ad70b967e1bdaf646e26890a1 + pristine_git_object: 9d83f0b400cc5a12ec0ad4f131d45c1d232acbbd + docs/Models/Components/PaymentMappingOptions.md: + id: 7985be0cf64e + last_write_checksum: sha1:1aab732ef03fbb35881c7a6c93a9cc22106d282d + pristine_git_object: ce7df255f6b4304c61320cf455a9b648b88290a5 + docs/Models/Components/Security.md: + id: 7bcd54fda13a + last_write_checksum: sha1:afb3c4b0cb11e752dd6bf6890c9331d4d0adc0cd + pristine_git_object: a997c0213ebb03783bfda0a7559d0e1f0fd7d463 + docs/Models/Components/SourceType.md: + id: c28bbe36cebc + last_write_checksum: sha1:f03d269bb54c4c8c38078a56ace7aba84193e83d + pristine_git_object: 3ddd34f70f3d4f0233402b8450a8002d16904e84 + docs/Models/Components/Supplier.md: + id: 39dd0f0a8bd0 + last_write_checksum: sha1:3f1379ff862f5cfaa621f10f5a75caa7a9433e2f + pristine_git_object: 3de574b773a26ce5d15bfa6ed2c92fe5800a39be + docs/Models/Components/SupplierPrototype.md: + id: 3be667e1fc6e + last_write_checksum: sha1:733739b96d7b22bc8b71042760fd88e7cfa47556 + pristine_git_object: 4e84d45dbf317ec0be3034bee792937ebdac49c2 + docs/Models/Components/SupplierRef.md: + id: e76f612c9913 + last_write_checksum: sha1:2dda3fdcf3d2bc31cba47e77e9bad77da1bf5c88 + pristine_git_object: ccbce3052ed5c3d132e507b438794e8457f8b370 + docs/Models/Components/SupplierStatus.md: + id: bcdaa17ab65f + last_write_checksum: sha1:3daf809a3b86d6c3c605f4bb4470837d3e091f00 + pristine_git_object: 328b27e13caa24656927d381050c965d48fda507 + docs/Models/Components/Suppliers.md: + id: f3463fb08a9a + last_write_checksum: sha1:9059ffa30305a120af8fc0ec0eb94ea0e39e07b5 + pristine_git_object: b504d691385a3bceef9de9b315aeb02e0e8cfe55 + docs/Models/Components/TaxRateMappingOption.md: + id: 6d021089bbc2 + last_write_checksum: sha1:a79075f5295ae2d7fbe79dd1a772113095e1ce23 + pristine_git_object: b836e0d114f066a168022f074266c89f919a69fb + docs/Models/Components/TaxRateStatus.md: + id: d98d8250b78a + last_write_checksum: sha1:692ab3f7ad9c1d471cfaa81df89664d473a36e7d + pristine_git_object: 5402adc318a6bf5da799b64bb0dcb2d9f65fd043 + docs/Models/Components/TrackingRef.md: + id: 2f5ee35bd7d6 + last_write_checksum: sha1:dfd2bde72eedcf47a95f8d2d7eba92e50357040c + pristine_git_object: 35573aec4e73ba82a1cc7259edf9348a45cebc34 + docs/Models/Errors/ErrorMessage.md: + id: 59d72a2b78b9 + last_write_checksum: sha1:aede0aa82c9fba75a2496535d5cea95c8180f73c + pristine_git_object: 375f0caa5dc4cce2c1456a387d75c396ac187078 + docs/Models/Requests/CreateBankAccountRequest.md: + id: a25992601305 + last_write_checksum: sha1:2e654e43b1d2cf699c31a949860804ec5e7638f8 + pristine_git_object: 69aa62ef65588ec57bc3fbce183f0f5e23d9c83a + docs/Models/Requests/CreateBankAccountResponse.md: + id: 43c6716abc9a + last_write_checksum: sha1:90b024058b4e952d6b74b997cd4a18b95c4ee4e4 + pristine_git_object: 4c2176ade982bacf02875cc1ae46e7f486798729 + docs/Models/Requests/CreateBillPaymentRequest.md: + id: d4ce607071d4 + last_write_checksum: sha1:033cad500ce92e00df4863931f23fd351ad0d5a0 + pristine_git_object: d476ddc01aa6545e6a0f3f97c2b022d854d5202d + docs/Models/Requests/CreateBillPaymentResponse.md: + id: 1b0e294f28bd + last_write_checksum: sha1:c98d6658c3b1746bf02da53ab91c5833e2c1619a + pristine_git_object: d8fa74c1d3d311c7041672b8b8626b2622b9b2ef + docs/Models/Requests/CreateBillRequest.md: + id: 3398d18f92da + last_write_checksum: sha1:e8f8250927a743ca22a4bc7cdb82b769f28d1644 + pristine_git_object: 632ec66223c315d1c99403e3ab6a5c151512c349 + docs/Models/Requests/CreateBillResponse.md: + id: e52311f9bd72 + last_write_checksum: sha1:2e00b3235b8183829197e8822172d08fc9ed6c3f + pristine_git_object: 1bf47387f16b36ad7a554937d9b504cfa7f28bbd + docs/Models/Requests/CreateCompanyResponse.md: + id: cfc32cab5fa2 + last_write_checksum: sha1:278dfc86bd4e09633136307908375fcc5a554584 + pristine_git_object: ebbbbda7fdc03c282b4143a53dd03fc2c75d285c + docs/Models/Requests/CreateConnectionRequest.md: + id: ea17f2f26eed + last_write_checksum: sha1:ae1f8a7a67d9ca5fc290a7611eff5daa44a7b956 + pristine_git_object: 82be5a89068b1d570aa342f33b7ae72bf462637f + docs/Models/Requests/CreateConnectionRequestBody.md: + id: 13bdb3f1e63d + last_write_checksum: sha1:3063d4c37caf5d0571fc8ed582c9a50226c9b6b2 + pristine_git_object: 303023338dfd380c8f811e80d67d61dcfa459be4 + docs/Models/Requests/CreateConnectionResponse.md: + id: 296991307ac1 + last_write_checksum: sha1:d892c341c798bc5d0548f4b5a461edc55548a584 + pristine_git_object: c9a1df658612745ce9916b7100d81505134a2f6b + docs/Models/Requests/CreateSupplierRequest.md: + id: afd5c52662d7 + last_write_checksum: sha1:fafde33aa64a829654b0a410a0783b0374b0a51e + pristine_git_object: 83da43f12b7403f267bc1aacf0de077845aa4359 + docs/Models/Requests/CreateSupplierResponse.md: + id: c15ccce7cea4 + last_write_checksum: sha1:67e8a4769af08d5bca4a0d5662b9be4908a96485 + pristine_git_object: a86de52ba35b12da3624c100bb22019f02bf67ad + docs/Models/Requests/DeleteCompanyRequest.md: + id: 648af31deb8b + last_write_checksum: sha1:9e3f4f795aad6591efb73848cf2a70c617dea1ec + pristine_git_object: f904d2c84655a379449b9c31ce666760d8ec5cb3 + docs/Models/Requests/DeleteCompanyResponse.md: + id: dbe048965eca + last_write_checksum: sha1:bc14b81759bbca45b06982ddab15a0bc30094559 + pristine_git_object: 503ad022105ca787a4c4c1a6aa2ddbb87abdc49e + docs/Models/Requests/DeleteConnectionRequest.md: + id: 59a9b310a32f + last_write_checksum: sha1:b4a46a3ba3236c3c4a93819ff7bc75215c58f032 + pristine_git_object: 3132fc2cfec48e479b767e78dfedb10f4e7b4632 + docs/Models/Requests/DeleteConnectionResponse.md: + id: cb910ab4c05d + last_write_checksum: sha1:daf41415e9a63b606c07e27493af9b9b8e977d64 + pristine_git_object: ce373caba7e53b86fa3a74ff11c52914beeb22d2 + docs/Models/Requests/DownloadBillAttachmentRequest.md: + id: 3f95c1d1821e + last_write_checksum: sha1:d3b54eabc3aaf3d551d5ea35f2b3ef5c1292dfe2 + pristine_git_object: 9c09dd0380bc58977c6e3d62275b47807993224e + docs/Models/Requests/DownloadBillAttachmentResponse.md: + id: 11e856d085e0 + last_write_checksum: sha1:eb3618ffbcfcc1df54a2e8279895a1eede64b345 + pristine_git_object: 3fa47499de58fb5ca4846636bbec7f00c4a82168 + docs/Models/Requests/GetCompanyInformationRequest.md: + id: 55dfbb0257aa + last_write_checksum: sha1:990754573f8ebe08e22158a1ac764e183462aa84 + pristine_git_object: 7699c8b224b0acc0869324b188acb399759799fe + docs/Models/Requests/GetCompanyInformationResponse.md: + id: 67835d2bd713 + last_write_checksum: sha1:8a0d96edbf2f266f60ace760d4aab05672c4085f + pristine_git_object: 7b92b7fbad3ee66f6e1692a9bbd48632663ed8fa + docs/Models/Requests/GetCompanyRequest.md: + id: d3f08c665a9d + last_write_checksum: sha1:2a5d0772b58020f36b42b784120e831b0e78ecb1 + pristine_git_object: b65ac93b3e3b337fcd283b6c0dbb3fa032fcee5e + docs/Models/Requests/GetCompanyResponse.md: + id: b49d5acc8f52 + last_write_checksum: sha1:2f04c91e3cf62f74cb8becfd547c398a0a8f2200 + pristine_git_object: 816d16523a09068618867800abbba073c32a3764 + docs/Models/Requests/GetConnectionRequest.md: + id: 55116a54bd44 + last_write_checksum: sha1:96b49d46b44f852fcf182df179d60db32b4c2ed3 + pristine_git_object: 5ebe8b8e55de1e2d14ee9c2215be4f49332e1b10 + docs/Models/Requests/GetConnectionResponse.md: + id: 0d0d4300ad6e + last_write_checksum: sha1:cac42cb0ba55fd388bb06d17c9f24d572e871318 + pristine_git_object: 84db1bc0b7b7dc5382b105e701892b7d6b7cdeb1 + docs/Models/Requests/GetMappingOptionsBillsRequest.md: + id: 7d2c54b0b615 + last_write_checksum: sha1:953b81ae052f3c8db25cf20465cb0832f45cc7fa + pristine_git_object: 2a8fc8383653d10a46c52a11d19968fc06b7d7ee + docs/Models/Requests/GetMappingOptionsBillsResponse.md: + id: cee0b1b0c02f + last_write_checksum: sha1:c6325640de80083786a41fb6d477143df55982cd + pristine_git_object: ed6f2f9049372f7d07b9eb14118932c284bc8dad + docs/Models/Requests/GetMappingOptionsPaymentsRequest.md: + id: 61b9924807d5 + last_write_checksum: sha1:eaa006dbd99c029b6734929500cd94a943209acb + pristine_git_object: 9c4aeff9a84f2ad3adca6fcfb44dca5f268a72c3 + docs/Models/Requests/GetMappingOptionsPaymentsResponse.md: + id: 868ae76f2acd + last_write_checksum: sha1:34b0e951406824c1a7ef4abe52a3f44fa7c8c56b + pristine_git_object: 13bcbd067c251d390653c3f4f2c2ad07f9736b4f + docs/Models/Requests/ListBillAttachmentsRequest.md: + id: cb981eb33427 + last_write_checksum: sha1:9e4f97357185bbddb8957845bbab63bf3da75c11 + pristine_git_object: 045f9cd5fade7b66d99e2ec82ea7b5db6bcb60c3 + docs/Models/Requests/ListBillAttachmentsResponse.md: + id: b3e0454c5c12 + last_write_checksum: sha1:09e56f71437628fba2d5ccdb33203199a2f98d72 + pristine_git_object: 0c47e5c39247bc7586398b2848c4675baeb058f5 + docs/Models/Requests/ListBillsRequest.md: + id: 4a766ab77782 + last_write_checksum: sha1:824b88fbdfeedb028b38d5665db1839d31cc7644 + pristine_git_object: c925654d2fc123dcf53b29cbc8c5242b2d89a109 + docs/Models/Requests/ListBillsResponse.md: + id: 763ef6fcbdde + last_write_checksum: sha1:a8dfd21086499247ab75832b904373d82de503ea + pristine_git_object: 88464ebd8e076ead6e63c07dfb506e79a06e8747 + docs/Models/Requests/ListCompaniesRequest.md: + id: 7ba05c60d65b + last_write_checksum: sha1:3cde84a069f3bd199f3cb04c7f0c2444a83552ba + pristine_git_object: 350f218c0123e7f7a00693689a2efe9884b4cc93 + docs/Models/Requests/ListCompaniesResponse.md: + id: 5ace27f2f4fb + last_write_checksum: sha1:58fb1979bd7e91e39e07e4d069b0be01a1240d10 + pristine_git_object: 26e3dde528d53fa237d3562059886e4ae8b8cd5d + docs/Models/Requests/ListConnectionsRequest.md: + id: 5ea7caf28403 + last_write_checksum: sha1:b27a417f6a13466e9b9a9d952216abca56bb496e + pristine_git_object: 1da5255ce43fc01920061e662236568de0f30ae3 + docs/Models/Requests/ListConnectionsResponse.md: + id: 5d5a6916f5f4 + last_write_checksum: sha1:b351065101f403c3aaecd989e3205300e1e1aba1 + pristine_git_object: 69f421519b106dd80ae57ee85b67950fda84a03e + docs/Models/Requests/ListSuppliersRequest.md: + id: f9e26d61a749 + last_write_checksum: sha1:12b27e5b366da5156484f3554dca3cd1ad8c07d9 + pristine_git_object: 4a8e938f941dbd7b4f7c18676f4c8d3cc315e93f + docs/Models/Requests/ListSuppliersResponse.md: + id: dab059f2c6e7 + last_write_checksum: sha1:4f863c5c6689ba55bc1af7f79e55c5a2f73f4df4 + pristine_git_object: f62c31984798e055499831399926c0bef167e279 + docs/Models/Requests/ReplaceCompanyRequest.md: + id: d6cd2bd48f75 + last_write_checksum: sha1:6fe90f5bd40cf0efd7540e6d8eaaf662e3505cf2 + pristine_git_object: b3b949cbb1528c01b55b70a94357b091276becd8 + docs/Models/Requests/ReplaceCompanyResponse.md: + id: 1b8c67e8f55d + last_write_checksum: sha1:68d4366960b748ad455e8e72b3b82d684b7e88aa + pristine_git_object: 46ff9ecbac96070af896dafb8a8826597389b547 + docs/Models/Requests/UnlinkConnectionRequest.md: + id: ef0b6070dff1 + last_write_checksum: sha1:fcf8ba79a029059eca540594e43388dfac16aed2 + pristine_git_object: d0fb2abaa694cef4fed22614bab97c3154b85dd3 + docs/Models/Requests/UnlinkConnectionResponse.md: + id: af3184a1e765 + last_write_checksum: sha1:21f48057af188b2f1bfecf58566f53013b4e9d89 + pristine_git_object: c4c577601f0141ab24263da460adc9ef1830f761 + docs/Models/Requests/UnlinkConnectionUpdateConnection.md: + id: 6f27b351f936 + last_write_checksum: sha1:8b618ce1c800a541139fde6f3c66e5c28d8db90f + pristine_git_object: 7cdc5825da2934771b0cd5944a388469204dcf55 + docs/Models/Requests/UpdateBillRequest.md: + id: dac87f5d39e4 + last_write_checksum: sha1:dc475a0ac5787cf1f250c141ab884f6dfc25c6ca + pristine_git_object: a156987fce690cbd6e03e3a1e06fb22d8e1a7f68 + docs/Models/Requests/UpdateBillResponse.md: + id: 12350297053f + last_write_checksum: sha1:48c871233e60f54ef96e65ff0dc5056baff92e03 + pristine_git_object: 7947d55c3045575373366afac6e1afa51854777b + docs/Models/Requests/UpdateCompanyRequest.md: + id: a9e8c8ac4776 + last_write_checksum: sha1:235a0d4a264b5a5f92d253bb1cadcac8a248a770 + pristine_git_object: 2351dd6e62e957aa6a9f0f0ecc43a2ec039e9bcc + docs/Models/Requests/UpdateCompanyResponse.md: + id: 81c4ddd700b4 + last_write_checksum: sha1:ac8e7f37088d015ddb7ec4635ffc99ed51daee22 + pristine_git_object: 7df91368deff7f172400090cbdda219f7d58c4f5 + docs/Models/Requests/UploadBillAttachmentRequest.md: + id: a0ce2dfa9f52 + last_write_checksum: sha1:77f49c36c53bbcfb3e58ad3664c4c1110db6fe01 + pristine_git_object: 36ee5d18965f730d9d71cb6a02d8d6c383ade0e6 + docs/Models/Requests/UploadBillAttachmentResponse.md: + id: 9bb5dad6968a + last_write_checksum: sha1:5524fc6de17624843ffdaa353197055bcf59ab71 + pristine_git_object: d06a42360b8a85ead3c4b6663a0498ae3a34d261 + docs/Models/Webhooks/ClientRateLimitReachedResponse.md: + id: c2fdaff5362d + last_write_checksum: sha1:55a031899f071b43c51844bd7be6711499eb100b + pristine_git_object: 7dbf08dbf61a190316d13ad765ed741783d76f15 + docs/Models/Webhooks/ClientRateLimitResetResponse.md: + id: d57017369cdb + last_write_checksum: sha1:cc433eb763f2a4fd0bb182d03f5adb2a99a60119 + pristine_git_object: 94e8224449b12d31bae84f283649675d21c0169f + docs/sdks/bankaccounts/README.md: + id: 510ffee224ea + last_write_checksum: sha1:e0e23414a0a6473e589c5f6088fbf6d456712968 + pristine_git_object: 74936b22543a42549912f115e8fa9c537e52647c + docs/sdks/billpayments/README.md: + id: 9436cf9c44bd + last_write_checksum: sha1:5710b393311270a59614e80d2642285ff86029d0 + pristine_git_object: 78b4049c081820c7612602eced80d5e66745c288 + docs/sdks/bills/README.md: + id: 2a9c97966ab7 + last_write_checksum: sha1:451aa35094000e2e229ac3e8181dc11e704568ad + pristine_git_object: 3d4d3ac8cbbd90176a74e6ba968c39c9f012488f + docs/sdks/companies/README.md: + id: 67e8a49afa67 + last_write_checksum: sha1:fa422bdc86239493921abeb75a666423d6db13ce + pristine_git_object: 6db449b0a0995b6719d864d625f47f9ad8ba4e19 + docs/sdks/companyinformation/README.md: + id: 319c7ed51023 + last_write_checksum: sha1:18a02b6bcd252f81072ce04f72e9f2c2b2cffec2 + pristine_git_object: 9cbe4503be26c95be6584f7866b3ac2e0d322b06 + docs/sdks/connections/README.md: + id: 3ef8931411ea + last_write_checksum: sha1:d13cbad34de1be5f5d80a45186ea9158d78b11ae + pristine_git_object: 9c618764bd5422a7a4a316b04f20ed573631c58f + docs/sdks/suppliers/README.md: + id: 85867190cd79 + last_write_checksum: sha1:3def1227797b999d658d6ffaefb2f2686eac7206 + pristine_git_object: 0e1124abf5ef70f2027b20670adfe565105bf1b3 + global.json: + id: 908e72401bf4 + last_write_checksum: sha1:3161b880f51cd74e7d1dea069b541d8bf4736dc9 + pristine_git_object: ef3195af86a7d6ef1e34296c380fd52d85b696fd examples: list-companies: - "": + speakeasy-default-list-companies: parameters: query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}]}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} One company: parameters: query: @@ -304,10 +1091,10 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - "400": {} + 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: @@ -315,10 +1102,10 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - "400": {} + 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: @@ -326,11 +1113,12 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: - "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]}], "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: {"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: @@ -338,58 +1126,53 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: - "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]}], "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: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-company: With no description: requestBody: - application/json: {"name": "Technicalium", "description": "Requested early access to the new financing scheme."} + application/json: {"name": "Technicalium"} responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} - "400": {} + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} With a description: requestBody: application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} responses: "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} - "400": {} - With a group: + 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": "Technicalium", "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]} + 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": "", "platform": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "groups": [{"id": "f8a6f6ed-9812-4d1e-ba48-4346348403c8"}]} - "400": {} + 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: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]} "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - With a tag: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} - update-company: + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + replace-company: Update name: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" requestBody: - application/json: {"name": "New Name", "description": "Requested early access to the new financing scheme."} + application/json: {"name": "New Name"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": {} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} Update description: parameters: path: @@ -398,8 +1181,11 @@ examples: application/json: {"name": "Same name", "description": "Additional documents required"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": {} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: @@ -407,60 +1193,126 @@ examples: 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", "description": "Requested early access to the new financing scheme.", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-company: - Unauthorized: + "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: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company: - Simple company: + 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": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} - "401": {} - With groups: + 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": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "My First Company", "description": "", "platform": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "groups": [{"id": "f8a6f6ed-9812-4d1e-ba48-4346348403c8"}]} - "401": {} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: 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", "description": "Requested early access to the new financing scheme.", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]} + 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", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} Subsidiary multi-entity company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} + application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} list-connections: - "": + speakeasy-default-list-connections: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" @@ -471,8 +1323,11 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} Connections: parameters: path: @@ -485,7 +1340,6 @@ examples: 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"}}} - "400": {} Malformed query: parameters: path: @@ -496,10 +1350,10 @@ examples: 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", "dataConnectionErrors": []}], "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: {"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: @@ -510,10 +1364,10 @@ examples: 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", "dataConnectionErrors": []}], "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: {"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: @@ -523,8 +1377,7 @@ examples: application/json: {"platformKey": "gbol"} responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} Unauthorized: parameters: path: @@ -532,10 +1385,10 @@ examples: 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", "dataConnectionErrors": []} "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: @@ -544,18 +1397,17 @@ examples: connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} Unauthorized: 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", "dataConnectionErrors": []} "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: @@ -565,6 +1417,18 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-delete-connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {} + "500": + application/json: {} unlink-connection: Example: parameters: @@ -575,18 +1439,33 @@ examples: application/json: {"status": "Unlinked"} responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: 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", "dataConnectionErrors": []} "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: @@ -596,7 +1475,6 @@ examples: responses: "200": application/json: {"companyName": "Bank of Dave", "baseCurrency": "GBP"} - "400": {} Malformed query: parameters: path: @@ -605,9 +1483,10 @@ examples: responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "200": {} + "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" @@ -617,8 +1496,11 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"accounts": [], "taxRates": []} - "400": {} + application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "610", "name": "Accounts Payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515"}]} + "400": + application/json: {} + "500": + application/json: {} Mapping options: parameters: path: @@ -629,8 +1511,7 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"accounts": [{"id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "879-i", "name": "Accounts payable", "type": "Liability", "currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "taxRates": [{"id": "d2939064-dd3a-4c0f-9865-a238c2193515", "name": "VAT @ 20%", "code": "VAT20", "effectiveTaxRate": 20, "totalTaxRate": 20, "status": "Active"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - "400": {} + 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: @@ -640,10 +1521,10 @@ examples: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" statusQuery: "status=Archived" responses: - "200": - application/json: {"accounts": [], "taxRate": []} "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: @@ -655,8 +1536,11 @@ examples: query: "status=Open" responses: "200": - application/json: {"results": []} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Status (partially paid): parameters: path: @@ -667,8 +1551,11 @@ examples: query: "status=PartiallyPaid" responses: "200": - application/json: {"results": []} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Source modified date: parameters: path: @@ -679,8 +1566,11 @@ examples: query: "sourceModifiedDate>2023-12-15T00:00:00.000Z" responses: "200": - application/json: {"results": []} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Status (open) & source modified date: parameters: path: @@ -691,8 +1581,11 @@ examples: query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open" responses: "200": - application/json: {"results": []} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Status (partially paid) & source modified date: parameters: path: @@ -703,8 +1596,11 @@ examples: query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid" responses: "200": - application/json: {"results": []} - "400": {} + application/json: {"results": [{"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Bills: parameters: path: @@ -714,8 +1610,7 @@ examples: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" responses: "200": - application/json: {"results": [{"id": "18", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": "1,", "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Open", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "22", "reference": "12", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "issueDate": "2019-05-13T00:00:00", "dueDate": "2019-05-13T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Dance shoes", "unitAmount": 5, "quantity": 1, "taxAmount": 0, "accountRef": {"id": "16"}, "totalAmount": 5, "taxRateRef": {"id": "NON"}}], "status": "Paid", "totalAmount": 5, "amountDue": 0, "sourceModifiedDate": "2022-05-26T10:34:10Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - "400": {} + 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: @@ -724,10 +1619,10 @@ examples: query: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" responses: - "200": - application/json: {"results": []} "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: @@ -736,82 +1631,118 @@ examples: query: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" responses: - "200": - application/json: {"results": []} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-bill: Create bill: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}}], "status": "Open"} + application/json: {"reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} responses: - "200": - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open", "sourceModifiedDate": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"} - "400": {} "201": - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "USD", "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} Created bill: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "USD", "status": "Open"} + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open"} responses: - "200": - application/json: {"id": "bill-1029932", "reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}}], "status": "Open", "totalAmount": 7267.2, "amountDue": 7267.2, "sourceModifiedDate": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"} - "400": {} "201": - application/json: {"id": "bill-1029932", "reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}}], "status": "Open", "totalAmount": 7267.2, "amountDue": 7267.2, "sourceModifiedDate": "2022-10-23T00:00:00Z"} + application/json: {"id": "bill-1029932", "reference": "bill_b8qmmj4ksf1suax", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-04-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Half day training - Microsoft Office", "unitAmount": 1800, "quantity": 1, "taxAmount": 360, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2160, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "unitAmount": 4000, "quantity": 1, "taxAmount": 800, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 4800, "taxRateRef": {"id": "INPUT2"}}, {"description": "Stationery charges", "unitAmount": 32, "quantity": 8, "taxAmount": 51.2, "accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "totalAmount": 307.2, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7267.2, "amountDue": 7267.2} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Open"} + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": null}], "status": "Open"} responses: - "200": - application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "EUR", "status": "Open", "sourceModifiedDate": {"sourceModifiedDate": "2022-10-23T00:00:00Z"}} "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - upload-bill-attachment: + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + update-bill: + Update bill: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "200": + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} + Updated bill: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "200": + application/json: {"id": "bill-1029932", "reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7800, "amountDue": 7800} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} responses: "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + upload-bill-attachment: Attachment metadata: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" responses: "201": application/json: {"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} list-bill-attachments: - Info: + Success: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" responses: "200": - application/json: {"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"} - "401": {} + 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: @@ -819,33 +1750,39 @@ examples: connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" responses: - "200": - application/json: {"dateCreated": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Attachments: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + download-bill-attachment: + Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: - "200": - application/json: [{"id": "422f093f-e556-4bf3-91c0-93af70c3e850", "name": "receipt.png", "contentType": "image/png", "dateCreated": "2022-10-23T00:00:00.000Z", "fileSize": 100, "includeWhenSent": true, "sourceModifiedDate": "2022-05-26T10:34:10Z"}, {"id": "20cfd269-2f0f-44ef-a28c-7b5f725cf1aa", "name": "another_receipt.png", "contentType": "image/png", "dateCreated": "2022-10-24T00:00:00.000Z", "fileSize": 98, "includeWhenSent": true, "sourceModifiedDate": "2022-05-27T12:38:10Z"}] - download-bill-attachment: - Unauthorized: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-download-bill-attachment: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "EILBDVJVNUAGVKRQ" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: + "200": + application/octet-stream: "0xDe2896EE66" "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "200": {} + application/json: {} + "500": + application/json: {} get-mapping-options-payments: - "": + speakeasy-default-get-mapping-options-payments: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" @@ -855,8 +1792,11 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"bankAccounts": []} - "400": {} + application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"}]} + "400": + application/json: {} + "500": + application/json: {} Mapping options: parameters: path: @@ -867,8 +1807,7 @@ examples: statusQuery: "status=Archived" responses: "200": - application/json: {"bankAccounts": [{"id": "3d5a8e00-d108-4045-8823-7f342676cffa", "name": "Bank of Dave current account", "accountNumber": "12345678", "nominalCode": "1234567", "sortCode": "123456", "currency": "GBP", "status": "Active", "accountType": "Debit", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "pagination": {"continuationToken": "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ=="}} - "400": {} + 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: @@ -878,39 +1817,35 @@ examples: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" statusQuery: "status=Archived" responses: - "200": - application/json: {"bankAccounts": []} "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-bill-payment: Bill payment example: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" - header: {} + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" requestBody: application/json: {"amount": 22, "date": "2022-10-23T00:00:00.000Z", "reference": "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": "7bda9f44sr56"}, "currencyRate": 1} responses: - "200": - 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": {} "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: "7110701885" - header: {} + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" requestBody: application/json: {"amount": 1329.54, "date": "2022-10-23T00:00:00Z", "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": ""}} responses: - "200": - 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} - "400": {} "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: @@ -918,15 +1853,14 @@ examples: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" - header: {} + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" requestBody: application/json: {"amount": 1329.54, "date": "2022-10-23T00:00:00Z", "reference": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "accountRef": {"id": ""}} responses: - "200": - 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: {"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: @@ -938,8 +1872,11 @@ examples: 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": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"}]} - "400": {} + 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: @@ -950,8 +1887,11 @@ examples: 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": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"}]} - "400": {} + 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: @@ -962,8 +1902,11 @@ examples: 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": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"}]} - "400": {} + 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: @@ -974,8 +1917,11 @@ examples: 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": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"}]} - "400": {} + 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: @@ -986,8 +1932,11 @@ examples: 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": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"}]} - "400": {} + 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: @@ -998,7 +1947,6 @@ examples: 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"}], "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=="}} - "400": {} Malformed query: parameters: path: @@ -1007,10 +1955,10 @@ examples: query: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" 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": {"sourceModifiedDate": "2022-10-23T00:00:00Z"}}]} "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: @@ -1019,64 +1967,327 @@ examples: query: continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==" 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": {"sourceModifiedDate": "2022-10-23T00:00:00Z"}}]} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-supplier: Suppliers: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: application/json: {"supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "addresses": [{"type": "Billing", "line1": "Flat 1", "line2": "2 Dennis Avenue", "city": "London", "region": "Camden", "country": "GBR", "postalCode": "EC1N 7TE"}], "status": "Active", "defaultCurrency": "GBP"} responses: - "200": - application/json: {"id": "sup-10933920", "supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "{\"sourceModifiedDate\":\"2022-10-23T00:00:00Z\"}"} - "400": {} "201": - application/json: {"id": "sup-10933920", "supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "status": "Active", "defaultCurrency": "GBP", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + application/json: {"id": "sup-10933920", "supplierName": "Greggs", "contactName": "Greg Greggs", "emailAddress": "greg@greggs.com", "phone": "+44 (0)1223 322410", "status": "Active", "defaultCurrency": "GBP"} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"supplierName": "", "phone": "(877) 492-8687", "status": "Active"} + application/json: {"supplierName": "", "phone": "+44 25691 154789", "status": "Unknown"} responses: - "200": - application/json: {"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": {"sourceModifiedDate": "2022-10-23T00:00:00Z"}} "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} create-bank-account: Bank account example: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: application/json: {"nominalCode": "22", "name": "Plutus - Payables - Bank Account 12", "accountType": "Debit", "accountNumber": "0120 0440", "sortCode": "50-50-50", "currency": "GBP"} responses: - "200": - application/json: {"currency": "USD", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} - "400": {} "201": - application/json: {"currency": "USD", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + application/json: {"currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - header: {} requestBody: - application/json: {"name": "", "accountType": "Credit", "accountNumber": "", "currency": "USD"} + application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} responses: - "200": - application/json: {"currency": "USD", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} "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: {} +examplesVersion: 1.0.2 generatedTests: {} +generatedFiles: + - .gitattributes + - CONTRIBUTING.md + - Codat.Sync.Payables.sln + - Codat/Sync/Payables/BankAccounts.cs + - Codat/Sync/Payables/BillPayments.cs + - Codat/Sync/Payables/Bills.cs + - Codat/Sync/Payables/Codat.Sync.Payables.csproj + - Codat/Sync/Payables/CodatSyncPayables.cs + - Codat/Sync/Payables/Companies.cs + - Codat/Sync/Payables/CompanyInformation.cs + - Codat/Sync/Payables/Connections.cs + - Codat/Sync/Payables/Hooks/HookTypes.cs + - Codat/Sync/Payables/Hooks/SDKHooks.cs + - Codat/Sync/Payables/Models/Components/AccountMappingOption.cs + - Codat/Sync/Payables/Models/Components/AccountStatus.cs + - Codat/Sync/Payables/Models/Components/Address.cs + - Codat/Sync/Payables/Models/Components/AddressType.cs + - Codat/Sync/Payables/Models/Components/Attachment.cs + - Codat/Sync/Payables/Models/Components/AttachmentUpload.cs + - Codat/Sync/Payables/Models/Components/BankAccount.cs + - Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs + - Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs + - Codat/Sync/Payables/Models/Components/BankAccountStatus.cs + - Codat/Sync/Payables/Models/Components/BankAccountType.cs + - Codat/Sync/Payables/Models/Components/Bill.cs + - Codat/Sync/Payables/Models/Components/BillAccountRef.cs + - Codat/Sync/Payables/Models/Components/BillLineItem.cs + - Codat/Sync/Payables/Models/Components/BillMappingOptions.cs + - Codat/Sync/Payables/Models/Components/BillPayment.cs + - Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs + - Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs + - Codat/Sync/Payables/Models/Components/BillPrototype.cs + - Codat/Sync/Payables/Models/Components/BillStatus.cs + - Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs + - Codat/Sync/Payables/Models/Components/Bills.cs + - Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhook.cs + - Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhookData.cs + - Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhook.cs + - Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhookData.cs + - Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs + - Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs + - Codat/Sync/Payables/Models/Components/CodatFile.cs + - Codat/Sync/Payables/Models/Components/Companies.cs + - Codat/Sync/Payables/Models/Components/Company.cs + - Codat/Sync/Payables/Models/Components/CompanyInformation.cs + - Codat/Sync/Payables/Models/Components/CompanyReference.cs + - Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs + - Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs + - Codat/Sync/Payables/Models/Components/Connection.cs + - Codat/Sync/Payables/Models/Components/Connections.cs + - Codat/Sync/Payables/Models/Components/DataConnectionError.cs + - Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs + - Codat/Sync/Payables/Models/Components/ErrorStatus.cs + - Codat/Sync/Payables/Models/Components/ErrorValidation.cs + - Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs + - Codat/Sync/Payables/Models/Components/HalRef.cs + - Codat/Sync/Payables/Models/Components/Links.cs + - Codat/Sync/Payables/Models/Components/Pagination.cs + - Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs + - Codat/Sync/Payables/Models/Components/Security.cs + - Codat/Sync/Payables/Models/Components/SourceType.cs + - Codat/Sync/Payables/Models/Components/Supplier.cs + - Codat/Sync/Payables/Models/Components/SupplierPrototype.cs + - Codat/Sync/Payables/Models/Components/SupplierRef.cs + - Codat/Sync/Payables/Models/Components/SupplierStatus.cs + - Codat/Sync/Payables/Models/Components/Suppliers.cs + - Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs + - Codat/Sync/Payables/Models/Components/TaxRateStatus.cs + - Codat/Sync/Payables/Models/Errors/ErrorMessage.cs + - Codat/Sync/Payables/Models/Errors/SDKException.cs + - Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs + - Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs + - Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs + - Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs + - Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs + - Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs + - Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs + - Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs + - Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs + - Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs + - Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs + - Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs + - Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs + - Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs + - Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs + - Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs + - Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs + - Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs + - Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs + - Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs + - Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs + - Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs + - Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs + - Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs + - Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs + - Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs + - Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs + - Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs + - Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs + - Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs + - Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs + - Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs + - Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs + - Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs + - Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs + - Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs + - Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs + - Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs + - Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs + - Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs + - Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs + - Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs + - Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs + - Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs + - Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs + - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs + - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse1.cs + - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs + - Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse1.cs + - Codat/Sync/Payables/Suppliers.cs + - Codat/Sync/Payables/Utils/AnyDeserializer.cs + - Codat/Sync/Payables/Utils/BigIntStrConverter.cs + - Codat/Sync/Payables/Utils/DecimalStrConverter.cs + - Codat/Sync/Payables/Utils/EnumConverter.cs + - Codat/Sync/Payables/Utils/FlexibleObjectDeserializer.cs + - Codat/Sync/Payables/Utils/HeaderSerializer.cs + - Codat/Sync/Payables/Utils/IsoDateTimeSerializer.cs + - Codat/Sync/Payables/Utils/RequestBodySerializer.cs + - Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs + - Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs + - Codat/Sync/Payables/Utils/Retries/Retries.cs + - Codat/Sync/Payables/Utils/Retries/RetryConfig.cs + - Codat/Sync/Payables/Utils/SecurityMetadata.cs + - Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs + - Codat/Sync/Payables/Utils/SpeakeasyMetadata.cs + - Codat/Sync/Payables/Utils/URLBuilder.cs + - Codat/Sync/Payables/Utils/Utilities.cs + - NUGET.md + - USAGE.md + - docs/Models/Components/AccountMappingOption.md + - docs/Models/Components/AccountStatus.md + - docs/Models/Components/Address.md + - docs/Models/Components/AddressType.md + - docs/Models/Components/Attachment.md + - docs/Models/Components/AttachmentUpload.md + - docs/Models/Components/BankAccount.md + - docs/Models/Components/BankAccountMappingOption.md + - docs/Models/Components/BankAccountPrototype.md + - docs/Models/Components/BankAccountStatus.md + - docs/Models/Components/BankAccountType.md + - docs/Models/Components/Bill.md + - docs/Models/Components/BillAccountRef.md + - docs/Models/Components/BillLineItem.md + - docs/Models/Components/BillMappingOptions.md + - docs/Models/Components/BillPayment.md + - docs/Models/Components/BillPaymentAccountRef.md + - docs/Models/Components/BillPaymentPrototype.md + - docs/Models/Components/BillPrototype.md + - docs/Models/Components/BillStatus.md + - docs/Models/Components/BillTaxRateRef.md + - docs/Models/Components/Bills.md + - docs/Models/Components/ClientRateLimitReachedWebhook.md + - docs/Models/Components/ClientRateLimitReachedWebhookData.md + - docs/Models/Components/ClientRateLimitResetWebhook.md + - docs/Models/Components/ClientRateLimitResetWebhookData.md + - docs/Models/Components/ClientRateLimitWebhook.md + - docs/Models/Components/ClientRateLimitWebhookPayload.md + - docs/Models/Components/CodatFile.md + - docs/Models/Components/Companies.md + - docs/Models/Components/Company.md + - docs/Models/Components/CompanyInformation.md + - docs/Models/Components/CompanyReference.md + - docs/Models/Components/CompanyReferenceLinks.md + - docs/Models/Components/CompanyRequestBody.md + - docs/Models/Components/Connection.md + - docs/Models/Components/Connections.md + - docs/Models/Components/DataConnectionError.md + - docs/Models/Components/DataConnectionStatus.md + - docs/Models/Components/ErrorStatus.md + - docs/Models/Components/ErrorValidation.md + - docs/Models/Components/ErrorValidationItem.md + - docs/Models/Components/HalRef.md + - docs/Models/Components/Links.md + - docs/Models/Components/Pagination.md + - docs/Models/Components/PaymentMappingOptions.md + - docs/Models/Components/Security.md + - docs/Models/Components/SourceType.md + - docs/Models/Components/Supplier.md + - docs/Models/Components/SupplierPrototype.md + - docs/Models/Components/SupplierRef.md + - docs/Models/Components/SupplierStatus.md + - docs/Models/Components/Suppliers.md + - docs/Models/Components/TaxRateMappingOption.md + - docs/Models/Components/TaxRateStatus.md + - docs/Models/Errors/ErrorMessage.md + - docs/Models/Requests/CreateBankAccountRequest.md + - docs/Models/Requests/CreateBankAccountResponse.md + - docs/Models/Requests/CreateBillPaymentRequest.md + - docs/Models/Requests/CreateBillPaymentResponse.md + - docs/Models/Requests/CreateBillRequest.md + - docs/Models/Requests/CreateBillResponse.md + - docs/Models/Requests/CreateCompanyResponse.md + - docs/Models/Requests/CreateConnectionRequest.md + - docs/Models/Requests/CreateConnectionRequestBody.md + - docs/Models/Requests/CreateConnectionResponse.md + - docs/Models/Requests/CreateSupplierRequest.md + - docs/Models/Requests/CreateSupplierResponse.md + - docs/Models/Requests/DeleteCompanyRequest.md + - docs/Models/Requests/DeleteCompanyResponse.md + - docs/Models/Requests/DeleteConnectionRequest.md + - docs/Models/Requests/DeleteConnectionResponse.md + - docs/Models/Requests/DownloadBillAttachmentRequest.md + - docs/Models/Requests/DownloadBillAttachmentResponse.md + - docs/Models/Requests/GetCompanyInformationRequest.md + - docs/Models/Requests/GetCompanyInformationResponse.md + - docs/Models/Requests/GetCompanyRequest.md + - docs/Models/Requests/GetCompanyResponse.md + - docs/Models/Requests/GetConnectionRequest.md + - docs/Models/Requests/GetConnectionResponse.md + - docs/Models/Requests/GetMappingOptionsBillsRequest.md + - docs/Models/Requests/GetMappingOptionsBillsResponse.md + - docs/Models/Requests/GetMappingOptionsPaymentsRequest.md + - docs/Models/Requests/GetMappingOptionsPaymentsResponse.md + - docs/Models/Requests/ListBillAttachmentsRequest.md + - docs/Models/Requests/ListBillAttachmentsResponse.md + - docs/Models/Requests/ListBillsRequest.md + - docs/Models/Requests/ListBillsResponse.md + - docs/Models/Requests/ListCompaniesRequest.md + - docs/Models/Requests/ListCompaniesResponse.md + - docs/Models/Requests/ListConnectionsRequest.md + - docs/Models/Requests/ListConnectionsResponse.md + - docs/Models/Requests/ListSuppliersRequest.md + - docs/Models/Requests/ListSuppliersResponse.md + - docs/Models/Requests/UnlinkConnectionRequest.md + - docs/Models/Requests/UnlinkConnectionResponse.md + - docs/Models/Requests/UnlinkConnectionUpdateConnection.md + - docs/Models/Requests/UpdateCompanyRequest.md + - docs/Models/Requests/UpdateCompanyResponse.md + - docs/Models/Requests/UploadBillAttachmentRequest.md + - docs/Models/Requests/UploadBillAttachmentResponse.md + - docs/Models/Webhooks/ClientRateLimitReachedResponse.md + - docs/Models/Webhooks/ClientRateLimitReachedResponse1.md + - docs/Models/Webhooks/ClientRateLimitResetResponse.md + - docs/Models/Webhooks/ClientRateLimitResetResponse1.md + - docs/sdks/bankaccounts/README.md + - docs/sdks/billpayments/README.md + - docs/sdks/bills/README.md + - docs/sdks/codatsyncpayables/README.md + - docs/sdks/companies/README.md + - docs/sdks/companyinformation/README.md + - docs/sdks/connections/README.md + - docs/sdks/suppliers/README.md + - global.json diff --git a/sync-for-payables/.speakeasy/gen.yaml b/sync-for-payables/.speakeasy/gen.yaml index 5afc1cf0c..7839aa08d 100644 --- a/sync-for-payables/.speakeasy/gen.yaml +++ b/sync-for-payables/.speakeasy/gen.yaml @@ -4,26 +4,44 @@ generation: maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true + nameResolutionFeb2025: false parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true + securityFeb2025: false + sharedErrorComponentsApr2025: false + sharedNestedComponentsJan2026: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + versioningStrategy: automatic + persistentEdits: {} + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false csharp: - version: 10.0.0 + version: 10.1.0 additionalDependencies: [] author: Codat + baseErrorName: CodatSyncPayablesException clientServerStatusCodesAsErrors: true defaultErrorName: SDKException description: Streamline your customers' accounts payable workflow. disableNamespacePascalCasingApr2024: true dotnetVersion: net8.0 + enableCancellationToken: false enableSourceLink: false flattenGlobalSecurity: true flatteningOrder: "" + httpClientPrefix: Speakeasy imports: option: openapi paths: @@ -33,11 +51,15 @@ csharp: shared: Models/Components webhooks: Models/Webhooks includeDebugSymbols: false + inferUnionDiscriminators: false inputModelSuffix: input maxMethodParams: 0 methodArguments: infer-optional-args + multipartArrayFormat: legacy outputModelSuffix: output packageName: Codat.Sync.Payables packageTags: "" + respectTitlesForPrimitiveUnionMembers: false responseFormat: envelope sourceDirectory: "" + useNodatime: true diff --git a/sync-for-payables/Codat/Sync/Payables/BankAccounts.cs b/sync-for-payables/Codat/Sync/Payables/BankAccounts.cs index 7af6ebbb3..6620be5e0 100644 --- a/sync-for-payables/Codat/Sync/Payables/BankAccounts.cs +++ b/sync-for-payables/Codat/Sync/Payables/BankAccounts.cs @@ -13,63 +13,86 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// - /// Create a bank account for a given company's connection. + /// Create a bank account for a given company's connection. /// public interface IBankAccounts { - /// - /// Create bank account - /// + /// Create bank account. + /// /// - /// The *Create bank account* endpoint creates a new bank account for a given company's connection.
+ /// The *Create bank account* endpoint creates a new bank account for a given company's connection.
///
/// Bank accounts are financial accounts maintained by a bank or other financial institution. ///
- /// - Task CreateAsync(CreateBankAccountRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task CreateAsync( + CreateBankAccountRequest request, + RetryConfig? retryConfig = null + ); } /// - /// Create a bank account for a given company's connection. + /// Create a bank account for a given company's connection. /// public class BankAccounts: IBankAccounts { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public BankAccounts(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public BankAccounts(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task CreateAsync(CreateBankAccountRequest request, RetryConfig? retryConfig = null) + /// + /// Create bank account. + /// + /// + /// The *Create bank account* endpoint creates a new bank account for a given company's connection.
+ ///
+ /// Bank accounts are financial accounts maintained by a bank or other financial institution. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task CreateAsync( + CreateBankAccountRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bankAccounts", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bankAccounts", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "BankAccountPrototype", "json", false, true); @@ -78,12 +101,12 @@ public async Task CreateAsync(CreateBankAccountReques httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-bank-account", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-bank-account", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -117,8 +140,8 @@ public async Task CreateAsync(CreateBankAccountReques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -128,7 +151,7 @@ public async Task CreateAsync(CreateBankAccountReques httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -158,7 +181,17 @@ public async Task CreateAsync(CreateBankAccountReques { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + BankAccount obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into BankAccount.", httpResponse, httpResponseBody, ex); + } + var response = new CreateBankAccountResponse() { StatusCode = responseStatusCode, @@ -169,24 +202,59 @@ public async Task CreateAsync(CreateBankAccountReques return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/BillPayments.cs b/sync-for-payables/Codat/Sync/Payables/BillPayments.cs index d6cb6ad52..57544ad51 100644 --- a/sync-for-payables/Codat/Sync/Payables/BillPayments.cs +++ b/sync-for-payables/Codat/Sync/Payables/BillPayments.cs @@ -13,44 +13,63 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Get, create, and update Bill payments. /// public interface IBillPayments { - /// - /// Get payment mapping options - /// + /// Get payment mapping options. + /// /// - /// Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID.
+ /// 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 to change that.
///
- /// Mapping options are a set of bank accounts used to configure the SMB's payables integration. + /// Mapping options are a set of bank accounts used to configure the SMB's payables integration. ///
- /// - Task GetPaymentOptionsAsync(GetMappingOptionsPaymentsRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task GetPaymentOptionsAsync( + GetMappingOptionsPaymentsRequest request, + RetryConfig? retryConfig = null + ); /// - /// Create bill payment - /// + /// Create bill payment. + /// /// - /// The *Create bill payment* endpoint creates a new bill payment for a given company's connection.
+ /// The *Create bill payment* endpoint creates a new bill payment for a given company's connection.
///
/// Bill payments are an allocation of money within any Accounts Payable account. ///
- /// - Task CreateAsync(CreateBillPaymentRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task CreateAsync( + CreateBillPaymentRequest request, + RetryConfig? retryConfig = null + ); } /// @@ -58,38 +77,54 @@ public interface IBillPayments /// public class BillPayments: IBillPayments { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public BillPayments(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public BillPayments(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task GetPaymentOptionsAsync(GetMappingOptionsPaymentsRequest request, RetryConfig? retryConfig = null) + /// + /// Get payment mapping options. + /// + /// + /// Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID.
+ ///
+ /// By default, this endpoint returns a list of active bank accounts. You can use querying to change that.
+ ///
+ /// Mapping options are a set of bank accounts used to configure the SMB's payables integration. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task GetPaymentOptionsAsync( + GetMappingOptionsPaymentsRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-mapping-options-payments", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-mapping-options-payments", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -123,8 +158,8 @@ public async Task GetPaymentOptionsAsync(GetM Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -134,7 +169,7 @@ public async Task GetPaymentOptionsAsync(GetM httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -164,7 +199,17 @@ public async Task GetPaymentOptionsAsync(GetM { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PaymentMappingOptions obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PaymentMappingOptions.", httpResponse, httpResponseBody, ex); + } + var response = new GetMappingOptionsPaymentsResponse() { StatusCode = responseStatusCode, @@ -175,33 +220,89 @@ public async Task GetPaymentOptionsAsync(GetM return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task CreateAsync(CreateBillPaymentRequest request, RetryConfig? retryConfig = null) + + /// + /// Create bill payment. + /// + /// + /// The *Create bill payment* endpoint creates a new bill payment for a given company's connection.
+ ///
+ /// Bill payments are an allocation of money within any Accounts Payable account. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task CreateAsync( + CreateBillPaymentRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "BillPaymentPrototype", "json", false, true); @@ -210,12 +311,12 @@ public async Task CreateAsync(CreateBillPaymentReques httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-bill-payment", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-bill-payment", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -249,8 +350,8 @@ public async Task CreateAsync(CreateBillPaymentReques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -260,7 +361,7 @@ public async Task CreateAsync(CreateBillPaymentReques httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -290,7 +391,17 @@ public async Task CreateAsync(CreateBillPaymentReques { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + BillPayment obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into BillPayment.", httpResponse, httpResponseBody, ex); + } + var response = new CreateBillPaymentResponse() { StatusCode = responseStatusCode, @@ -301,24 +412,59 @@ public async Task CreateAsync(CreateBillPaymentReques return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 409, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Bills.cs b/sync-for-payables/Codat/Sync/Payables/Bills.cs index b918aa045..7e98dc123 100644 --- a/sync-for-payables/Codat/Sync/Payables/Bills.cs +++ b/sync-for-payables/Codat/Sync/Payables/Bills.cs @@ -13,93 +13,174 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Get, create, and update Bills. /// public interface IBills { - /// - /// Get bill mapping options - /// + /// Get bill mapping options. + /// /// - /// Use the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company's connection ID.
+ /// 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 to change that.
///
- /// Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. + /// Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. ///
- /// - Task GetBillOptionsAsync(GetMappingOptionsBillsRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task GetBillOptionsAsync( + GetMappingOptionsBillsRequest request, + RetryConfig? retryConfig = null + ); /// - /// List bills - /// + /// List bills. + /// /// - /// The *List bills* endpoint returns a list of bills for a given company's connection.
+ /// The *List bills* endpoint returns a list of bills for a given company's connection.
///
- /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.
+ /// Bills 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. + /// By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. ///
- /// - Task ListAsync(ListBillsRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task ListAsync(ListBillsRequest request, RetryConfig? retryConfig = null); /// - /// Create bill - /// + /// Create bill. + /// /// - /// The *Create bill* endpoint creates a new bill for a given company's connection.
+ /// The *Create bill* endpoint creates a new bill for a given company's connection.
///
- /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task CreateAsync(CreateBillRequest request, RetryConfig? retryConfig = null); + + /// + /// Update bill. /// - Task CreateAsync(CreateBillRequest request, RetryConfig? retryConfig = null); + /// + /// The *Update bill* endpoint updates an existing bill for a given company's connection.
+ ///
+ /// Bills 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 | + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task UpdateAsync(UpdateBillRequest request, RetryConfig? retryConfig = null); /// - /// Upload bill attachment - /// + /// Upload bill attachment. + /// /// /// The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`.
///
- /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ///
- /// - Task UploadAttachmentAsync(UploadBillAttachmentRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task UploadAttachmentAsync( + UploadBillAttachmentRequest request, + RetryConfig? retryConfig = null + ); /// - /// List bill attachments - /// + /// List bill attachments. + /// /// /// The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.
///
- /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ///
- /// - Task ListAttachmentsAsync(ListBillAttachmentsRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task ListAttachmentsAsync( + ListBillAttachmentsRequest request, + RetryConfig? retryConfig = null + ); /// - /// Download bill attachment - /// + /// Download bill attachment. + /// /// /// The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
///
- /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.
+ /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.
///
- /// Check out our coverage explorer for integrations that support downloading a bill attachment.
- /// + /// Check out our coverage explorer for integrations that support downloading a bill attachment. ///
- /// - Task DownloadAttachmentAsync(DownloadBillAttachmentRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task DownloadAttachmentAsync( + DownloadBillAttachmentRequest request, + RetryConfig? retryConfig = null + ); } /// @@ -107,38 +188,54 @@ public interface IBills /// public class Bills: IBills { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public Bills(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public Bills(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task GetBillOptionsAsync(GetMappingOptionsBillsRequest request, RetryConfig? retryConfig = null) + /// + /// Get bill mapping options. + /// + /// + /// 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 to change that.
+ ///
+ /// Mapping options are a set of accounts and tax rates used to configure the SMB's payables integration. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task GetBillOptionsAsync( + GetMappingOptionsBillsRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-mapping-options-bills", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-mapping-options-bills", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -172,8 +269,8 @@ public async Task GetBillOptionsAsync(GetMapping Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -183,7 +280,7 @@ public async Task GetBillOptionsAsync(GetMapping httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -213,7 +310,17 @@ public async Task GetBillOptionsAsync(GetMapping { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + BillMappingOptions obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into BillMappingOptions.", httpResponse, httpResponseBody, ex); + } + var response = new GetMappingOptionsBillsResponse() { StatusCode = responseStatusCode, @@ -224,40 +331,95 @@ public async Task GetBillOptionsAsync(GetMapping return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task ListAsync(ListBillsRequest request, RetryConfig? retryConfig = null) + + /// + /// List bills. + /// + /// + /// The *List bills* endpoint returns a list of bills for a given company's connection.
+ ///
+ /// Bills 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. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task ListAsync(ListBillsRequest request, RetryConfig? retryConfig = null) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-bills", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-bills", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -291,8 +453,8 @@ public async Task ListAsync(ListBillsRequest request, RetryCo Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -302,7 +464,7 @@ public async Task ListAsync(ListBillsRequest request, RetryCo httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -332,7 +494,17 @@ public async Task ListAsync(ListBillsRequest request, RetryCo { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Bills obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Bills.", httpResponse, httpResponseBody, ex); + } + var response = new ListBillsResponse() { StatusCode = responseStatusCode, @@ -343,33 +515,86 @@ public async Task ListAsync(ListBillsRequest request, RetryCo return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 409, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task CreateAsync(CreateBillRequest request, RetryConfig? retryConfig = null) + + /// + /// Create bill. + /// + /// + /// The *Create bill* endpoint creates a new bill for a given company's connection.
+ ///
+ /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task CreateAsync(CreateBillRequest request, RetryConfig? retryConfig = null) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "BillPrototype", "json", false, true); @@ -378,12 +603,12 @@ public async Task CreateAsync(CreateBillRequest request, Ret httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-bill", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-bill", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -417,8 +642,8 @@ public async Task CreateAsync(CreateBillRequest request, Ret Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -428,7 +653,7 @@ public async Task CreateAsync(CreateBillRequest request, Ret httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -458,7 +683,17 @@ public async Task CreateAsync(CreateBillRequest request, Ret { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Bill obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Bill.", httpResponse, httpResponseBody, ex); + } + var response = new CreateBillResponse() { StatusCode = responseStatusCode, @@ -469,33 +704,289 @@ public async Task CreateAsync(CreateBillRequest request, Ret return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 409, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + + /// + /// Update bill. + /// + /// + /// The *Update bill* endpoint updates an existing bill for a given company's connection.
+ ///
+ /// Bills 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 | + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task UpdateAsync(UpdateBillRequest request, RetryConfig? retryConfig = null) + { + if (request == null) throw new ArgumentNullException(nameof(request)); + + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}", request, null); + + var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + HeaderSerializer.PopulateHeaders(ref httpRequest, request); + + var serializedBody = RequestBodySerializer.Serialize(request, "BillPrototype", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "update-bill", null, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await retries.Run(); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Bill obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Bill.", httpResponse, httpResponseBody, ex); + } + + var response = new UpdateBillResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.Bill = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 409, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task UploadAttachmentAsync(UploadBillAttachmentRequest request, RetryConfig? retryConfig = null) + + /// + /// Upload bill attachment. + /// + /// + /// The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`.
+ ///
+ /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task UploadAttachmentAsync( + UploadBillAttachmentRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "AttachmentUpload", "multipart", false, true); if (serializedBody != null) @@ -503,12 +994,12 @@ public async Task UploadAttachmentAsync(UploadBill httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("upload-bill-attachment", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "upload-bill-attachment", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -542,8 +1033,8 @@ public async Task UploadAttachmentAsync(UploadBill Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -553,7 +1044,7 @@ public async Task UploadAttachmentAsync(UploadBill httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -583,7 +1074,17 @@ public async Task UploadAttachmentAsync(UploadBill { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Attachment obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Attachment.", httpResponse, httpResponseBody, ex); + } + var response = new UploadBillAttachmentResponse() { StatusCode = responseStatusCode, @@ -594,40 +1095,96 @@ public async Task UploadAttachmentAsync(UploadBill return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task ListAttachmentsAsync(ListBillAttachmentsRequest request, RetryConfig? retryConfig = null) + + /// + /// List bill attachments. + /// + /// + /// The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.
+ ///
+ /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task ListAttachmentsAsync( + ListBillAttachmentsRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-bill-attachments", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-bill-attachments", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -661,8 +1218,8 @@ public async Task ListAttachmentsAsync(ListBillAtta Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -672,7 +1229,7 @@ public async Task ListAttachmentsAsync(ListBillAtta httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -702,7 +1259,17 @@ public async Task ListAttachmentsAsync(ListBillAtta { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + List obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull>(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into List.", httpResponse, httpResponseBody, ex); + } + var response = new ListBillAttachmentsResponse() { StatusCode = responseStatusCode, @@ -713,40 +1280,98 @@ public async Task ListAttachmentsAsync(ListBillAtta return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 409, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task DownloadAttachmentAsync(DownloadBillAttachmentRequest request, RetryConfig? retryConfig = null) + + /// + /// Download bill attachment. + /// + /// + /// The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`.
+ ///
+ /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.
+ ///
+ /// Check out our coverage explorer for integrations that support downloading a bill attachment. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task DownloadAttachmentAsync( + DownloadBillAttachmentRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("download-bill-attachment", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "download-bill-attachment", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -780,8 +1405,8 @@ public async Task DownloadAttachmentAsync(Downlo Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -791,7 +1416,7 @@ public async Task DownloadAttachmentAsync(Downlo httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -831,24 +1456,59 @@ public async Task DownloadAttachmentAsync(Downlo return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Codat.Sync.Payables.csproj b/sync-for-payables/Codat/Sync/Payables/Codat.Sync.Payables.csproj index 5d699f46f..e6d31a518 100644 --- a/sync-for-payables/Codat/Sync/Payables/Codat.Sync.Payables.csproj +++ b/sync-for-payables/Codat/Sync/Payables/Codat.Sync.Payables.csproj @@ -3,42 +3,13 @@ true Codat.Sync.Payables - 10.0.0 + 10.1.0 net8.0 Codat - Copyright (c) Codat 2024 + Copyright (c) Codat 2026 https://github.com/codatio/client-sdk-csharp.git git - Bill pay kit: The API reference for the Bill Pay kit.
-
-The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software.
-
-Explore product | See OpenAPI spec
-
----
-## Supported Integrations
-
-| Integration | Supported |
-|-------------------------------|-----------|
-| FreeAgent | Yes |
-| QuickBooks Online | Yes |
-| Oracle NetSuite | Yes |
-| Xero | Yes |
-
----
-<!-- Start Codat Tags Table -->
-## 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. |
-<!-- End Codat Tags Table -->
+ Streamline your customers' accounts payable workflow.
diff --git a/sync-for-payables/Codat/Sync/Payables/CodatSyncPayables.cs b/sync-for-payables/Codat/Sync/Payables/CodatSyncPayables.cs index b45e34d33..f7b0c5503 100644 --- a/sync-for-payables/Codat/Sync/Payables/CodatSyncPayables.cs +++ b/sync-for-payables/Codat/Sync/Payables/CodatSyncPayables.cs @@ -12,22 +12,19 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Hooks; using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; - /// - /// Bill pay kit: The API reference for the Bill Pay kit.
- /// - /// + /// Bill pay (synchronous solution): The API reference for the synchronous Bill Pay solution.
///
- /// The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software.
+ /// The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software.
///
- /// Explore product | See OpenAPI spec
+ /// Explore solution | See OpenAPI spec ///
/// ---
/// ## Supported Integrations
@@ -37,7 +34,9 @@ namespace Codat.Sync.Payables /// | FreeAgent | Yes |
/// | QuickBooks Online | Yes |
/// | Oracle NetSuite | Yes |
+ /// | Sage Intacct | Yes |
/// | Xero | Yes |
+ /// | Zoho Books | Yes |
///
/// ---
/// <!-- Start Codat Tags Table -->
@@ -45,21 +44,19 @@ namespace Codat.Sync.Payables ///
/// | Endpoints | Description |
/// | :- |:- |
- /// | Companies | Create and manage your SMB users' companies. |
+ /// | 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. |
+ /// | Bank accounts | Create a bank account for a given company's connection. |
/// <!-- End Codat Tags Table --> - ///
///
public interface ICodatSyncPayables { - /// - /// Create and manage your SMB users' companies. + /// Create and manage your SMB users' companies. /// public ICompanies Companies { get; } @@ -89,54 +86,17 @@ public interface ICodatSyncPayables public ISuppliers Suppliers { get; } /// - /// Create a bank account for a given company's connection. + /// Create a bank account for a given company's connection. /// public IBankAccounts BankAccounts { get; } } - public class SDKConfig - { - /// - /// List of server URLs available to the SDK. - /// - public static readonly string[] ServerList = { - "https://api.codat.io", - }; - - public string ServerUrl = ""; - public int ServerIndex = 0; - public SDKHooks Hooks = new SDKHooks(); - public RetryConfig? RetryConfig = null; - - public string GetTemplatedServerUrl() - { - if (!String.IsNullOrEmpty(this.ServerUrl)) - { - return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); - } - return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary()); - } - - public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client) - { - string preHooksUrl = GetTemplatedServerUrl(); - var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client); - if (preHooksUrl != postHooksUrl) - { - this.ServerUrl = postHooksUrl; - } - return postHooksClient; - } - } - /// - /// Bill pay kit: The API reference for the Bill Pay kit.
- /// - /// + /// Bill pay (synchronous solution): The API reference for the synchronous Bill Pay solution.
///
- /// The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software.
+ /// The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software.
///
- /// Explore product | See OpenAPI spec
+ /// Explore solution | See OpenAPI spec ///
/// ---
/// ## Supported Integrations
@@ -146,7 +106,9 @@ public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client) /// | FreeAgent | Yes |
/// | QuickBooks Online | Yes |
/// | Oracle NetSuite | Yes |
+ /// | Sage Intacct | Yes |
/// | Xero | Yes |
+ /// | Zoho Books | Yes |
///
/// ---
/// <!-- Start Codat Tags Table -->
@@ -154,46 +116,102 @@ public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client) ///
/// | Endpoints | Description |
/// | :- |:- |
- /// | Companies | Create and manage your SMB users' companies. |
+ /// | 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. |
+ /// | Bank accounts | Create a bank account for a given company's connection. |
/// <!-- End Codat Tags Table --> - ///
///
public class CodatSyncPayables: ICodatSyncPayables { + /// + /// The main SDK Configuration. + /// public SDKConfig SDKConfiguration { get; private set; } - - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private int _serverIndex = 0; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; + /// + /// The Companies sub-SDK. + /// public ICompanies Companies { get; private set; } + /// + /// The Connections sub-SDK. + /// public IConnections Connections { get; private set; } + /// + /// The CompanyInformation sub-SDK. + /// public ICompanyInformation CompanyInformation { get; private set; } + /// + /// The Bills sub-SDK. + /// public IBills Bills { get; private set; } + /// + /// The BillPayments sub-SDK. + /// public IBillPayments BillPayments { get; private set; } + /// + /// The Suppliers sub-SDK. + /// public ISuppliers Suppliers { get; private set; } + /// + /// The BankAccounts sub-SDK. + /// public IBankAccounts BankAccounts { get; private set; } - public CodatSyncPayables(string? authHeader = null, Func? authHeaderSource = null, int? serverIndex = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null) + /// + /// Initializes a new instance of the SDK based on a configuration object. + /// + /// The SDK configuration object. + public CodatSyncPayables(SDKConfig config) + { + SDKConfiguration = config; + InitHooks(); + + Companies = new Companies(SDKConfiguration); + + Connections = new Connections(SDKConfiguration); + + CompanyInformation = new CompanyInformation(SDKConfiguration); + + Bills = new Bills(SDKConfiguration); + + BillPayments = new BillPayments(SDKConfiguration); + + Suppliers = new Suppliers(SDKConfiguration); + + BankAccounts = new BankAccounts(SDKConfiguration); + } + + /// + /// Initializes a new instance of the SDK with optional configuration parameters. + /// + /// The security configuration to use for API requests. If provided, this will be used as a static security configuration. + /// A function that returns the security configuration dynamically. This takes precedence over the static security parameter if both are provided. + /// The index of the server to use from the predefined server list. Must be between 0 and the length of the server list. Defaults to 0 if not specified. + /// A custom server URL to use instead of the predefined server list. If provided with urlParams, the URL will be templated with the provided parameters. + /// A dictionary of parameters to use for templating the serverUrl. Only used when serverUrl is provided. + /// A custom HTTP client implementation to use for making API requests. If not provided, the default SpeakeasyHttpClient will be used. + /// Configuration for retry behavior when API requests fail. Defines retry strategies, backoff policies, and maximum retry attempts. + /// Invalid value provided for : must be between 0 (inclusive) and 1 (exclusive). + /// None of and were provided. + public CodatSyncPayables( + string? authHeader = null, + Func? authHeaderSource = null, + int? serverIndex = null, + string? serverUrl = null, + Dictionary? urlParams = null, + ISpeakeasyHttpClient? client = null, + RetryConfig? retryConfig = null + ) { if (serverIndex != null) { if (serverIndex.Value < 0 || serverIndex.Value >= SDKConfig.ServerList.Length) { - throw new Exception($"Invalid server index {serverIndex.Value}"); + throw new ArgumentOutOfRangeException($"Invalid server index {serverIndex}: must be between 0 (inclusive) and {SDKConfig.ServerList.Length} (exclusive)." ); } - _serverIndex = serverIndex.Value; } if (serverUrl != null) @@ -202,10 +220,8 @@ public CodatSyncPayables(string? authHeader = null, Func? authHeaderSour { serverUrl = Utilities.TemplateUrl(serverUrl, urlParams); } - _serverUrl = serverUrl; } - - _client = client ?? new SpeakeasyHttpClient(); + Func? _securitySource = null; if(authHeaderSource != null) { @@ -217,38 +233,131 @@ public CodatSyncPayables(string? authHeader = null, Func? authHeaderSour } else { - throw new Exception("authHeader and authHeaderSource cannot both be null"); + throw new ArgumentException("authHeader and authHeaderSource cannot both be null"); } - SDKConfiguration = new SDKConfig() + SDKConfiguration = new SDKConfig(client) { - ServerIndex = _serverIndex, - ServerUrl = _serverUrl, + ServerIndex = serverIndex == null ? 0 : serverIndex.Value, + ServerUrl = serverUrl == null ? "" : serverUrl, + SecuritySource = _securitySource, RetryConfig = retryConfig }; - _client = SDKConfiguration.InitHooks(_client); + InitHooks(); + Companies = new Companies(SDKConfiguration); - Companies = new Companies(_client, _securitySource, _serverUrl, SDKConfiguration); + Connections = new Connections(SDKConfiguration); + CompanyInformation = new CompanyInformation(SDKConfiguration); - Connections = new Connections(_client, _securitySource, _serverUrl, SDKConfiguration); + Bills = new Bills(SDKConfiguration); + BillPayments = new BillPayments(SDKConfiguration); - CompanyInformation = new CompanyInformation(_client, _securitySource, _serverUrl, SDKConfiguration); + Suppliers = new Suppliers(SDKConfiguration); + BankAccounts = new BankAccounts(SDKConfiguration); + } - Bills = new Bills(_client, _securitySource, _serverUrl, SDKConfiguration); + private void InitHooks() + { + string preHooksUrl = SDKConfiguration.GetTemplatedServerUrl(); + var (postHooksUrl, postHooksClient) = SDKConfiguration.Hooks.SDKInit(preHooksUrl, SDKConfiguration.Client); + var config = SDKConfiguration; + if (preHooksUrl != postHooksUrl) + { + config.ServerUrl = postHooksUrl; + } + config.Client = postHooksClient; + SDKConfiguration = config; + } + /// + /// Builder class for constructing an instance of the SDK. + /// + public class SDKBuilder + { + private SDKConfig _sdkConfig = new SDKConfig(client: new SpeakeasyHttpClient()); - BillPayments = new BillPayments(_client, _securitySource, _serverUrl, SDKConfiguration); + public SDKBuilder() { } + /// + /// Overrides the default server by index. + /// + public SDKBuilder WithServerIndex(int serverIndex) + { + if (serverIndex < 0 || serverIndex >= SDKConfig.ServerList.Length) + { + throw new ArgumentOutOfRangeException($"Invalid server index {serverIndex}: must be between 0 (inclusive) and {SDKConfig.ServerList.Length} (exclusive)." ); + } + _sdkConfig.ServerIndex = serverIndex; + return this; + } - Suppliers = new Suppliers(_client, _securitySource, _serverUrl, SDKConfiguration); + /// + /// Overrides the default server URL for the SDK. + /// + public SDKBuilder WithServerUrl(string serverUrl, Dictionary? serverVariables = null) + { + if (serverVariables != null) + { + serverUrl = Utilities.TemplateUrl(serverUrl, serverVariables); + } + _sdkConfig.ServerUrl = serverUrl; + return this; + } + /// + /// Sets the authHeaderSource security parameter for the SDK. + /// + public SDKBuilder WithAuthHeaderSource(Func authHeaderSource) + { + _sdkConfig.SecuritySource = () => new Codat.Sync.Payables.Models.Components.Security() { AuthHeader = authHeaderSource() }; + return this; + } + + /// + /// Sets the authHeader security parameter for the SDK. + /// + public SDKBuilder WithAuthHeader(string authHeader) + { + _sdkConfig.SecuritySource = () => new Codat.Sync.Payables.Models.Components.Security() { AuthHeader = authHeader }; + return this; + } + + /// + /// Sets a custom HTTP client to be used by the SDK. + /// + public SDKBuilder WithClient(ISpeakeasyHttpClient client) + { + _sdkConfig.Client = client; + return this; + } + + /// + /// Sets the retry configuration for the SDK. + /// + public SDKBuilder WithRetryConfig(RetryConfig retryConfig) + { + _sdkConfig.RetryConfig = retryConfig; + return this; + } + + /// + /// Builds and returns the SDK instance. + /// + public CodatSyncPayables Build() + { + if (_sdkConfig.SecuritySource == null) { + throw new ArgumentException("securitySource cannot be null. One of `AuthHeader` or `authHeaderSource` needs to be defined."); + } + return new CodatSyncPayables(_sdkConfig); + } - BankAccounts = new BankAccounts(_client, _securitySource, _serverUrl, SDKConfiguration); } + + public static SDKBuilder Builder() => new SDKBuilder(); } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Companies.cs b/sync-for-payables/Codat/Sync/Payables/Companies.cs index 8075ed57a..a99d2af22 100644 --- a/sync-for-payables/Codat/Sync/Payables/Companies.cs +++ b/sync-for-payables/Codat/Sync/Payables/Companies.cs @@ -13,36 +13,57 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// - /// Create and manage your SMB users' companies. + /// Create and manage your SMB users' companies. /// public interface ICompanies { - /// - /// List companies - /// + /// List companies. + /// /// /// The *List companies* endpoint returns a list of companies associated to your instances.
///
/// A company represents a business sharing access to their data.
- /// Each company can have multiple connections 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. + /// Each company can have multiple connections 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. It supports the following operators with Codat’s query language:
+ ///
+ /// - 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` ///
- /// - Task ListAsync(ListCompaniesRequest? request = null, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task ListAsync( + ListCompaniesRequest? request = null, + RetryConfig? retryConfig = null + ); /// - /// Create company - /// + /// Create company. + /// /// /// Use the *Create company* endpoint to create a new company that represents your customer in Codat.
///
@@ -51,85 +72,158 @@ public interface ICompanies ///
/// 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`. ///
- /// - Task CreateAsync(CompanyRequestBody? request = null, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task CreateAsync( + CompanyRequestBody? request = null, + RetryConfig? retryConfig = null + ); /// - /// Update company - /// + /// Replace company. + /// /// - /// Use the *Update company* endpoint to update both the name and description of the company.
+ /// Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.
///
/// A company represents a business sharing access to their data.
/// Each company can have multiple connections 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. ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task ReplaceAsync(ReplaceCompanyRequest request, RetryConfig? retryConfig = null); + + /// + /// Update company. /// - Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null); + /// + /// 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 represents a business sharing access to their data. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null); /// - /// Delete a company - /// + /// Delete a company. + /// /// /// The *Delete company* endpoint permanently deletes a company, its connections and any cached data. This operation is irreversible.
///
/// A company represents a business sharing access to their data.
- /// Each company can have multiple connections 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.
- /// + /// Each company can have multiple connections 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. ///
- /// - Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null); /// - /// Get company - /// + /// Get company. + /// /// /// The *Get company* endpoint returns a single company for a given `companyId`.
///
/// A company represents a business sharing access to their data.
- /// Each company can have multiple connections 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.
- /// + /// Each company can have multiple connections 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. ///
- /// - Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null); } /// - /// Create and manage your SMB users' companies. + /// Create and manage your SMB users' companies. /// public class Companies: ICompanies { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public Companies(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public Companies(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task ListAsync(ListCompaniesRequest? request = null, RetryConfig? retryConfig = null) + /// + /// List companies. + /// + /// + /// The *List companies* endpoint returns a list of companies associated to your instances.
+ ///
+ /// A company represents a business sharing access to their data.
+ /// Each company can have multiple connections 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. It supports the following operators with Codat’s query language:
+ ///
+ /// - 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` + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task ListAsync( + ListCompaniesRequest? request = null, + RetryConfig? retryConfig = null + ) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies", request); + var urlString = URLBuilder.Build(baseUrl, "/companies", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-companies", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-companies", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -163,8 +257,8 @@ public async Task ListAsync(ListCompaniesRequest? request Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -174,7 +268,7 @@ public async Task ListAsync(ListCompaniesRequest? request httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -204,7 +298,17 @@ public async Task ListAsync(ListCompaniesRequest? request { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Companies obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Companies.", httpResponse, httpResponseBody, ex); + } + var response = new ListCompaniesResponse() { StatusCode = responseStatusCode, @@ -215,34 +319,89 @@ public async Task ListAsync(ListCompaniesRequest? request return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task CreateAsync(CompanyRequestBody? request = null, RetryConfig? retryConfig = null) + + /// + /// Create company. + /// + /// + /// Use the *Create company* endpoint to create a new company that represents your customer in Codat.
+ ///
+ /// A company represents a business sharing access to their data.
+ /// Each company can have multiple connections 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`. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task CreateAsync( + CompanyRequestBody? request = null, + RetryConfig? retryConfig = null + ) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = baseUrl + "/companies"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -250,12 +409,12 @@ public async Task CreateAsync(CompanyRequestBody? request httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -289,8 +448,8 @@ public async Task CreateAsync(CompanyRequestBody? request Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -300,7 +459,7 @@ public async Task CreateAsync(CompanyRequestBody? request httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -330,7 +489,17 @@ public async Task CreateAsync(CompanyRequestBody? request { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + var response = new CreateCompanyResponse() { StatusCode = responseStatusCode, @@ -341,33 +510,90 @@ public async Task CreateAsync(CompanyRequestBody? request return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null) + + /// + /// Replace company. + /// + /// + /// Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.
+ ///
+ /// A company represents a business sharing access to their data.
+ /// Each company can have multiple connections 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. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task ReplaceAsync( + ReplaceCompanyRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "CompanyRequestBody", "json", false, true); if (serializedBody != null) @@ -375,12 +601,12 @@ public async Task UpdateAsync(UpdateCompanyRequest reques httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("update-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "replace-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -414,8 +640,8 @@ public async Task UpdateAsync(UpdateCompanyRequest reques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -425,7 +651,7 @@ public async Task UpdateAsync(UpdateCompanyRequest reques httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -455,7 +681,210 @@ public async Task UpdateAsync(UpdateCompanyRequest reques { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + + var response = new ReplaceCompanyResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.Company = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + + /// + /// Update company. + /// + /// + /// Use the *Update company* endpoint to update the name, description, or tags of the company.
+ ///
+ /// The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update.
+ ///
+ /// A company represents a business sharing access to their data. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task UpdateAsync( + UpdateCompanyRequest request, + RetryConfig? retryConfig = null + ) + { + if (request == null) throw new ArgumentNullException(nameof(request)); + + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request, null); + + var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "CompanyUpdateRequest", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "update-company", null, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await retries.Run(); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + var response = new UpdateCompanyResponse() { StatusCode = responseStatusCode, @@ -466,40 +895,97 @@ public async Task UpdateAsync(UpdateCompanyRequest reques return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null) + + /// + /// Delete a company. + /// + /// + /// The *Delete company* endpoint permanently deletes a company, its connections and any cached data. This operation is irreversible.
+ ///
+ /// A company represents a business sharing access to their data.
+ /// Each company can have multiple connections 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. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task DeleteAsync( + DeleteCompanyRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("delete-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "delete-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -533,8 +1019,8 @@ public async Task DeleteAsync(DeleteCompanyRequest reques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -544,7 +1030,7 @@ public async Task DeleteAsync(DeleteCompanyRequest reques httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -571,7 +1057,7 @@ public async Task DeleteAsync(DeleteCompanyRequest reques var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new DeleteCompanyResponse() { StatusCode = responseStatusCode, @@ -579,38 +1065,92 @@ public async Task DeleteAsync(DeleteCompanyRequest reques RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null) + + /// + /// Get company. + /// + /// + /// The *Get company* endpoint returns a single company for a given `companyId`.
+ ///
+ /// A company represents a business sharing access to their data.
+ /// Each company can have multiple connections 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. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -644,8 +1184,8 @@ public async Task GetAsync(GetCompanyRequest request, RetryC Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -655,7 +1195,7 @@ public async Task GetAsync(GetCompanyRequest request, RetryC httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -685,7 +1225,17 @@ public async Task GetAsync(GetCompanyRequest request, RetryC { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + var response = new GetCompanyResponse() { StatusCode = responseStatusCode, @@ -696,24 +1246,59 @@ public async Task GetAsync(GetCompanyRequest request, RetryC return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/CompanyInformation.cs b/sync-for-payables/Codat/Sync/Payables/CompanyInformation.cs index 1c393fc79..3950ffaea 100644 --- a/sync-for-payables/Codat/Sync/Payables/CompanyInformation.cs +++ b/sync-for-payables/Codat/Sync/Payables/CompanyInformation.cs @@ -13,31 +13,38 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// View company profile from the source platform. /// public interface ICompanyInformation { - /// - /// Get company information - /// + /// Get company information. + /// /// - /// Use the *Get company information* endpoint to return information about the company available from the underlying accounting software.
- ///
- /// + /// Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. ///
- /// - Task GetAsync(GetCompanyInformationRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task GetAsync( + GetCompanyInformationRequest request, + RetryConfig? retryConfig = null + ); } /// @@ -45,38 +52,50 @@ public interface ICompanyInformation /// public class CompanyInformation: ICompanyInformation { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public CompanyInformation(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public CompanyInformation(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task GetAsync(GetCompanyInformationRequest request, RetryConfig? retryConfig = null) + /// + /// Get company information. + /// + /// + /// Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + /// + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task GetAsync( + GetCompanyInformationRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/info", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/info", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-company-information", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-company-information", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -110,8 +129,8 @@ public async Task GetAsync(GetCompanyInformationR Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -121,7 +140,7 @@ public async Task GetAsync(GetCompanyInformationR httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -151,7 +170,17 @@ public async Task GetAsync(GetCompanyInformationR { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.CompanyInformation obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.CompanyInformation.", httpResponse, httpResponseBody, ex); + } + var response = new GetCompanyInformationResponse() { StatusCode = responseStatusCode, @@ -162,24 +191,59 @@ public async Task GetAsync(GetCompanyInformationR return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Connections.cs b/sync-for-payables/Codat/Sync/Payables/Connections.cs index 549da5375..d9402de39 100644 --- a/sync-for-payables/Codat/Sync/Payables/Connections.cs +++ b/sync-for-payables/Codat/Sync/Payables/Connections.cs @@ -13,68 +13,111 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Create new and manage existing data connections for a company. /// public interface IConnections { - /// - /// List connections - /// + /// List connections. + /// /// /// List the connections for a company. /// - /// - Task ListAsync(ListConnectionsRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task ListAsync(ListConnectionsRequest request, RetryConfig? retryConfig = null); /// - /// Create connection - /// + /// Create connection. + /// /// /// Creates a connection for the company by providing a valid `platformKey`.
///
- /// Use the List Integrations endpoint to access valid platform keys. + /// Use the List Integrations endpoint to access valid platform keys. ///
- /// - Task CreateAsync(CreateConnectionRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task CreateAsync( + CreateConnectionRequest request, + RetryConfig? retryConfig = null + ); /// - /// Get connection - /// + /// Get connection. + /// /// /// Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. /// - /// - Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null); /// - /// Delete connection - /// + /// Delete connection. + /// /// /// Revoke and remove a connection from a company.
/// This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. ///
- /// - Task DeleteAsync(DeleteConnectionRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task DeleteAsync( + DeleteConnectionRequest request, + RetryConfig? retryConfig = null + ); /// - /// Unlink connection - /// + /// Unlink connection. + /// /// /// This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. /// - /// - Task UnlinkAsync(UnlinkConnectionRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task UnlinkAsync( + UnlinkConnectionRequest request, + RetryConfig? retryConfig = null + ); } /// @@ -82,38 +125,50 @@ public interface IConnections /// public class Connections: IConnections { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public Connections(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public Connections(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task ListAsync(ListConnectionsRequest request, RetryConfig? retryConfig = null) + /// + /// List connections. + /// + /// + /// List the connections for a company. + /// + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task ListAsync( + ListConnectionsRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-connections", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-connections", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -147,8 +202,8 @@ public async Task ListAsync(ListConnectionsRequest requ Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -158,7 +213,7 @@ public async Task ListAsync(ListConnectionsRequest requ httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -188,7 +243,17 @@ public async Task ListAsync(ListConnectionsRequest requ { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Connections obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Connections.", httpResponse, httpResponseBody, ex); + } + var response = new ListConnectionsResponse() { StatusCode = responseStatusCode, @@ -199,33 +264,89 @@ public async Task ListAsync(ListConnectionsRequest requ return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task CreateAsync(CreateConnectionRequest request, RetryConfig? retryConfig = null) + + /// + /// Create connection. + /// + /// + /// Creates a connection for the company by providing a valid `platformKey`.
+ ///
+ /// Use the List Integrations endpoint to access valid platform keys. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task CreateAsync( + CreateConnectionRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) @@ -233,12 +354,12 @@ public async Task CreateAsync(CreateConnectionRequest httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -272,8 +393,8 @@ public async Task CreateAsync(CreateConnectionRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -283,7 +404,7 @@ public async Task CreateAsync(CreateConnectionRequest httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -313,7 +434,17 @@ public async Task CreateAsync(CreateConnectionRequest { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new CreateConnectionResponse() { StatusCode = responseStatusCode, @@ -324,40 +455,91 @@ public async Task CreateAsync(CreateConnectionRequest return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null) + + /// + /// Get connection. + /// + /// + /// Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + /// + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -391,8 +573,8 @@ public async Task GetAsync(GetConnectionRequest request, Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -402,7 +584,7 @@ public async Task GetAsync(GetConnectionRequest request, httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -432,7 +614,17 @@ public async Task GetAsync(GetConnectionRequest request, { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new GetConnectionResponse() { StatusCode = responseStatusCode, @@ -443,40 +635,95 @@ public async Task GetAsync(GetConnectionRequest request, return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task DeleteAsync(DeleteConnectionRequest request, RetryConfig? retryConfig = null) + + /// + /// Delete connection. + /// + /// + /// Revoke and remove a connection from a company.
+ /// This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task DeleteAsync( + DeleteConnectionRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("delete-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "delete-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -510,8 +757,8 @@ public async Task DeleteAsync(DeleteConnectionRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -521,7 +768,7 @@ public async Task DeleteAsync(DeleteConnectionRequest httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -548,7 +795,7 @@ public async Task DeleteAsync(DeleteConnectionRequest var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 200) - { + { return new DeleteConnectionResponse() { StatusCode = responseStatusCode, @@ -556,31 +803,85 @@ public async Task DeleteAsync(DeleteConnectionRequest RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task UnlinkAsync(UnlinkConnectionRequest request, RetryConfig? retryConfig = null) + + /// + /// Unlink connection. + /// + /// + /// This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + /// + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your API request was not properly authorized. Thrown when the API returns a 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task UnlinkAsync( + UnlinkConnectionRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) @@ -588,12 +889,12 @@ public async Task UnlinkAsync(UnlinkConnectionRequest httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("unlink-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "unlink-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -627,8 +928,8 @@ public async Task UnlinkAsync(UnlinkConnectionRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -638,7 +939,7 @@ public async Task UnlinkAsync(UnlinkConnectionRequest httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -668,7 +969,17 @@ public async Task UnlinkAsync(UnlinkConnectionRequest { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new UnlinkConnectionResponse() { StatusCode = responseStatusCode, @@ -679,24 +990,59 @@ public async Task UnlinkAsync(UnlinkConnectionRequest return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Hooks/HookTypes.cs b/sync-for-payables/Codat/Sync/Payables/Hooks/HookTypes.cs index d607d057a..59980e150 100644 --- a/sync-for-payables/Codat/Sync/Payables/Hooks/HookTypes.cs +++ b/sync-for-payables/Codat/Sync/Payables/Hooks/HookTypes.cs @@ -15,36 +15,61 @@ namespace Codat.Sync.Payables.Hooks using System.Threading.Tasks; using Codat.Sync.Payables.Utils; + /// + /// Base context class containing information passed to hooks during request execution. + /// public class HookContext { + public SDKConfig SDKConfiguration { get; set; } + public string BaseURL { get; set; } = ""; public string OperationID { get; set; } public List? Oauth2Scopes { get; set; } public Func? SecuritySource { get; set; } - public HookContext(string operationID, List? oauth2Scopes, Func? securitySource) + public HookContext(SDKConfig config, string baseURL, string operationID, List? oauth2Scopes, Func? securitySource) { + SDKConfiguration = config; + BaseURL = baseURL; OperationID = operationID; Oauth2Scopes = oauth2Scopes; SecuritySource = securitySource; } + + public HookContext(HookContext hookCtx) + { + SDKConfiguration = hookCtx.SDKConfiguration; + BaseURL = hookCtx.BaseURL; + OperationID = hookCtx.OperationID; + Oauth2Scopes = hookCtx.Oauth2Scopes; + SecuritySource = hookCtx.SecuritySource; + } } + /// + /// Context passed to before request hooks. + /// public class BeforeRequestContext : HookContext { public BeforeRequestContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } + /// + /// Context passed to after success hooks. + /// public class AfterSuccessContext : HookContext { public AfterSuccessContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } + /// + /// Context passed to after error hooks. + /// public class AfterErrorContext : HookContext { public AfterErrorContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } /// @@ -66,7 +91,7 @@ public interface IBeforeRequestHook } /// - /// AfterSuccessAsync is called after the SDK receives a response. + /// AfterSuccessAsync hook is called after the SDK receives a successful response. /// The hook can modify the response before it is handled or throw an exception to stop the response from being handled. /// public interface IAfterSuccessHook @@ -75,16 +100,19 @@ public interface IAfterSuccessHook } /// - /// AfterErrorAsync is called after the SDK encounters an error, or a non-successful response. + /// AfterErrorAsync hook is called after the SDK encounters an error or a non-successful response. /// The hook can modify the response, if available, otherwise modify the error. - /// All hooks are called sequentially. If an error is returned, it will be passed to the subsequent hook implementing IAfterErrorHook. - /// If you want to prevent other AfterError hooks from being run, you can throw an FailEarlyException instead. + /// All hooks are called sequentially. If an error is returned, it will be passed to the subsequent after error hook. + /// If you want to prevent other after error hooks from being run, you can throw a instead. /// public interface IAfterErrorHook { Task<(HttpResponseMessage?, Exception?)> AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error); } + /// + /// Interface for managing SDK hook registrations. + /// public interface IHooks { void RegisterSDKInitHook(ISDKInitHook hook); diff --git a/sync-for-payables/Codat/Sync/Payables/Hooks/SDKHooks.cs b/sync-for-payables/Codat/Sync/Payables/Hooks/SDKHooks.cs index 9c8761b83..87f331a1d 100644 --- a/sync-for-payables/Codat/Sync/Payables/Hooks/SDKHooks.cs +++ b/sync-for-payables/Codat/Sync/Payables/Hooks/SDKHooks.cs @@ -15,8 +15,14 @@ namespace Codat.Sync.Payables.Hooks using System.Net.Http; using System.Threading.Tasks; + /// + /// Exception that can be thrown in implementations to prevent subsequent hooks from executing. + /// public sealed class FailEarlyException : Exception {} + /// + /// Manages and executes SDK hooks at various stages of the request lifecycle. + /// public class SDKHooks: IHooks { public List sdkInitHooks; @@ -33,26 +39,48 @@ public SDKHooks() HookRegistration.InitHooks(this); } + /// + /// Registers an SDK initialization hook to be executed when the SDK is initialized. + /// + /// The hook to register. public void RegisterSDKInitHook(ISDKInitHook hook) { this.sdkInitHooks.Add(hook); } + /// + /// Registers a before request hook to be executed before each HTTP request. + /// + /// The hook to register. public void RegisterBeforeRequestHook(IBeforeRequestHook hook) { this.beforeRequestHooks.Add(hook); } + /// + /// Registers an after success hook to be executed after successful HTTP responses. + /// + /// The hook to register. public void RegisterAfterSuccessHook(IAfterSuccessHook hook) { this.afterSuccessHooks.Add(hook); } + /// + /// Registers an after error hook to be executed after errors or non-successful responses. + /// + /// The hook to register. public void RegisterAfterErrorHook(IAfterErrorHook hook) { this.afterErrorHooks.Add(hook); } - + + /// + /// Executes all registered SDK initialization hooks. + /// + /// The base URL for the SDK. + /// The HTTP client. + /// The potentially modified base URL and HTTP client. public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client) { var urlAndClient = (baseUrl, client); @@ -68,7 +96,13 @@ public void RegisterAfterErrorHook(IAfterErrorHook hook) } return urlAndClient; } - + + /// + /// Executes all registered before request hooks. + /// + /// The hook context containing request metadata. + /// The HTTP request message. + /// The potentially modified HTTP request message. public async Task BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request) { foreach (var hook in this.beforeRequestHooks) @@ -76,7 +110,8 @@ public async Task BeforeRequestAsync(BeforeRequestContext ho try { request = await hook.BeforeRequestAsync(hookCtx, request); - } catch (Exception ex) + } + catch (Exception ex) { throw new Exception("An error occurred while calling BeforeRequestAsync hook", ex); } @@ -84,6 +119,12 @@ public async Task BeforeRequestAsync(BeforeRequestContext ho return request; } + /// + /// Executes all registered after success hooks. + /// + /// The hook context containing request metadata. + /// The HTTP response message. + /// The potentially modified HTTP response message. public async Task AfterSuccessAsync(AfterSuccessContext hookCtx, HttpResponseMessage response) { foreach (var hook in this.afterSuccessHooks) @@ -100,19 +141,28 @@ public async Task AfterSuccessAsync(AfterSuccessContext hoo return response; } + /// + /// Executes all registered after error hooks. + /// + /// The hook context containing request metadata. + /// The HTTP response message, if available. + /// The exception that occurred, if any. + /// The potentially modified HTTP response message. + /// Thrown by a hook to prevent subsequent error hooks from executing. public async Task AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error) { - (HttpResponseMessage?, Exception?) responseAndError = (response, error); foreach (var hook in this.afterErrorHooks) { try { responseAndError = await hook.AfterErrorAsync(hookCtx, responseAndError.Item1, responseAndError.Item2); - } catch (FailEarlyException) + } + catch (FailEarlyException) { throw; - } catch (Exception ex) + } + catch (Exception ex) { throw new Exception("An error occurred while calling AfterErrorAsync hook", ex); } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountMappingOption.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountMappingOption.cs index 124d39ef9..214db6382 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountMappingOption.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountMappingOption.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class AccountMappingOption { - /// /// Identifier for the account, unique for the company. /// @@ -23,7 +22,7 @@ public class AccountMappingOption public string? Id { get; set; } /// - /// 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. + /// 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. /// [JsonProperty("nominalCode")] public string? NominalCode { get; set; } = null; @@ -42,15 +41,12 @@ public class AccountMappingOption /// /// The currency data type in Codat is the 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. - ///
///
[JsonProperty("currency")] public string? Currency { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountStatus.cs index f1e23d0e1..381e22b94 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/AccountStatus.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// The current status of the account. /// @@ -56,5 +56,4 @@ public static AccountStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum AccountStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Address.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Address.cs index d291cc24a..0325099f4 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Address.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Address.cs @@ -12,12 +12,11 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class Address { - /// - /// The type of the address + /// The type of the address. /// [JsonProperty("type")] public AddressType? Type { get; set; } @@ -47,7 +46,7 @@ public class Address public string? Region { get; set; } = null; /// - /// Country of the customer's address. For NetSuite, use the 2-digit ISO 3166 country code. + /// Country of the customer's address. For NetSuite, use the 2-digit ISO 3166 country code. /// [JsonProperty("country")] public string? Country { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/AddressType.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/AddressType.cs index 167e0038e..7d105cc1e 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/AddressType.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/AddressType.cs @@ -12,9 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// - /// The type of the address + /// The type of the address. /// public enum AddressType { @@ -58,5 +58,4 @@ public static AddressType ToEnum(this string value) throw new Exception($"Unknown value {value} for enum AddressType"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Attachment.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Attachment.cs index c65d7f1aa..d6edd27e4 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Attachment.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Attachment.cs @@ -11,17 +11,15 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// - /// The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes.
- /// - /// + /// 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 for attachments.
+ /// Unlike other data types, Codat doesn't support sync settings for attachments.
///
/// Note that different integrations have different requirements for file size and extension of attachments.
///
@@ -30,12 +28,10 @@ namespace Codat.Sync.Payables.Models.Components /// | 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 <a className="external" href="https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice" target="_blank">here</a> that "You can attach any type of file, such as text, image, or video files". | - ///
+ /// | 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". | ///
public class Attachment { - /// /// Identifier for the attachment, unique for the company in the accounting software. /// @@ -50,19 +46,14 @@ public class Attachment /// /// File type of the attachment. This is represented by appending the file type to the IETF standard file naming requirements. For example, for a jpeg file the output is **image/jpeg**.
- /// - /// ///
- /// Supported file types vary per platform. - ///
+ /// Supported file types vary per platform. ///
[JsonProperty("contentType")] public string? ContentType { get; set; } = null; /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -81,7 +72,6 @@ public class Attachment /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("dateCreated")] public string? DateCreated { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/AttachmentUpload.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/AttachmentUpload.cs index 40528d358..d8ddf20f4 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/AttachmentUpload.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/AttachmentUpload.cs @@ -11,14 +11,13 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class AttachmentUpload { - /// /// The file to be uploaded as an attachment. /// - [SpeakeasyMetadata("multipartForm:file")] + [SpeakeasyMetadata("multipartForm:file,name=file")] public CodatFile File { get; set; } = default!; } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccount.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccount.cs index 20112898a..eac234aa2 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccount.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccount.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class BankAccount { - /// /// Identifier for the bank account, unique for the company in the accounting software. /// @@ -36,50 +35,38 @@ public class BankAccount /// /// 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. - ///
///
[JsonProperty("accountType")] public BankAccountType? AccountType { get; set; } /// /// 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. - ///
///
[JsonProperty("accountNumber")] public string? AccountNumber { get; set; } = 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. - ///
///
[JsonProperty("sortCode")] public string? SortCode { get; set; } = null; /// /// The currency data type in Codat is the 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. - ///
///
[JsonProperty("currency")] public string? Currency { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs index 237a58542..47dc7f5ed 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountMappingOption.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class BankAccountMappingOption { - /// /// Identifier for the account, unique for the company in the accounting software. /// @@ -30,12 +29,9 @@ public class BankAccountMappingOption /// /// 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. - ///
///
[JsonProperty("accountNumber")] public string? AccountNumber { get; set; } = null; @@ -48,18 +44,15 @@ public class BankAccountMappingOption /// /// 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. - ///
///
[JsonProperty("sortCode")] public string? SortCode { get; set; } = null; /// - /// The bank account's base currency. + /// The bank account's base currency. /// [JsonProperty("currency")] public string? Currency { get; set; } = null; @@ -72,11 +65,8 @@ public class BankAccountMappingOption /// /// 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. - ///
///
[JsonProperty("accountType")] public BankAccountType? AccountType { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs index 709470379..261c33904 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountPrototype.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class BankAccountPrototype { - /// /// Code used to identify each nominal account for a business. /// @@ -30,50 +29,38 @@ public class BankAccountPrototype /// /// 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. - ///
///
[JsonProperty("accountType")] public BankAccountType AccountType { get; set; } = default!; /// /// 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. - ///
///
[JsonProperty("accountNumber", NullValueHandling = NullValueHandling.Include)] public string? AccountNumber { get; set; } /// /// 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. - ///
///
[JsonProperty("sortCode")] public string? SortCode { get; set; } = null; /// /// The currency data type in Codat is the 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. - ///
///
[JsonProperty("currency")] public string Currency { get; set; } = default!; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountStatus.cs index fc88def4d..00aa13702 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountStatus.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// The current status of the bank account. /// @@ -56,5 +56,4 @@ public static BankAccountStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum BankAccountStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountType.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountType.cs index 6bd439c8d..b9e49ea4a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountType.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BankAccountType.cs @@ -12,14 +12,11 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// 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. - ///
///
public enum BankAccountType { @@ -63,5 +60,4 @@ public static BankAccountType ToEnum(this string value) throw new Exception($"Unknown value {value} for enum BankAccountType"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Bill.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Bill.cs index 3e578cc7d..89e93c5c9 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Bill.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Bill.cs @@ -13,13 +13,12 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// - /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + /// Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. /// public class Bill { - /// /// Identifier for the bill, unique for the company in the accounting software. /// @@ -46,27 +45,22 @@ public class Bill /// /// The currency data type in Codat is the 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. - ///
///
[JsonProperty("currency")] public string Currency { get; set; } = default!; /// /// 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.
+ /// 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).
///
@@ -94,7 +88,6 @@ public class Bill /// | 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. | - ///
///
[JsonProperty("currencyRate")] public decimal? CurrencyRate { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillAccountRef.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillAccountRef.cs index 159dabfe5..bb2090c15 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillAccountRef.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillAccountRef.cs @@ -11,15 +11,14 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// /// Reference to the account to which the line item is linked. /// public class BillAccountRef { - /// - /// 'id' from the Accounts data type. + /// 'id' from the Accounts data type. /// [JsonProperty("id")] public string? Id { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillLineItem.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillLineItem.cs index d224b95d7..010d588c0 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillLineItem.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillLineItem.cs @@ -12,10 +12,10 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + using System.Collections.Generic; + public class BillLineItem { - /// /// Friendly name of the goods or services received. /// @@ -26,13 +26,13 @@ public class BillLineItem /// Unit price of the goods or service. ///
[JsonProperty("unitAmount")] - public decimal UnitAmount { get; set; } = default!; + public decimal? UnitAmount { get; set; } /// /// Number of units of goods or services received. /// [JsonProperty("quantity")] - public decimal Quantity { get; set; } = default!; + public decimal? Quantity { get; set; } /// /// Amount of tax applied to the line item. @@ -44,7 +44,7 @@ public class BillLineItem /// Reference to the account to which the line item is linked. /// [JsonProperty("accountRef")] - public BillAccountRef AccountRef { get; set; } = default!; + public BillAccountRef? AccountRef { get; set; } /// /// Total amount of the line, including tax. @@ -57,5 +57,8 @@ public class BillLineItem /// [JsonProperty("taxRateRef")] public BillTaxRateRef? TaxRateRef { get; set; } + + [JsonProperty("trackingRefs")] + public List? TrackingRefs { get; set; } = null; } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillMappingOptions.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillMappingOptions.cs index c80fc3370..6ad8721e0 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillMappingOptions.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillMappingOptions.cs @@ -13,15 +13,14 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// - /// The bill mapping options for a company's accounting software. + /// The bill mapping options for a company's accounting software. /// public class BillMappingOptions { - [JsonProperty("accounts")] - public List? Accounts { get; set; } + public List? Accounts { get; set; } [JsonProperty("taxRates")] public List? TaxRates { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPayment.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPayment.cs index 3e8c13456..8d95c40ef 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPayment.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPayment.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class BillPayment { - /// /// Identifier for the bill payment, unique for the company in the accounting software. /// @@ -45,12 +44,10 @@ public class BillPayment /// /// 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.
+ /// 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).
///
@@ -78,7 +75,6 @@ public class BillPayment /// | 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. | - ///
///
[JsonProperty("currencyRate")] public decimal? CurrencyRate { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs index 764f5b46d..fa340b6ec 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentAccountRef.cs @@ -11,15 +11,14 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// /// Reference to the bank account / credit card which you are using to pay the bill. /// public class BillPaymentAccountRef { - /// - /// Unique ID of the bank account / credit card + /// Unique ID of the bank account / credit card. /// [JsonProperty("id")] public string Id { get; set; } = default!; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs index 3ac1781c9..e3f867bea 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPaymentPrototype.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class BillPaymentPrototype { - /// /// Amount of the payment in the bill currency. /// @@ -39,12 +38,10 @@ public class BillPaymentPrototype /// /// 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.
+ /// 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).
///
@@ -72,7 +69,6 @@ public class BillPaymentPrototype /// | 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. | - ///
///
[JsonProperty("currencyRate")] public decimal? CurrencyRate { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPrototype.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPrototype.cs index a67076a35..42213c22f 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPrototype.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillPrototype.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class BillPrototype { - /// /// User-friendly reference for the bill. /// @@ -37,27 +36,22 @@ public class BillPrototype /// /// The currency data type in Codat is the 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. - ///
///
[JsonProperty("currency")] public string Currency { get; set; } = default!; /// /// 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.
+ /// 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).
///
@@ -85,7 +79,6 @@ public class BillPrototype /// | 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. | - ///
///
[JsonProperty("currencyRate")] public decimal? CurrencyRate { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillStatus.cs index 51544f64c..e73a65017 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillStatus.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// Current state of the bill. If creating a bill the status must be `Open`. /// @@ -64,5 +64,4 @@ public static BillStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum BillStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs index 94f06db62..5a2756c75 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/BillTaxRateRef.cs @@ -11,13 +11,12 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// /// Reference to the tax rate to which the line item is linked. /// public class BillTaxRateRef { - /// /// Unique identifier for the tax rate in the accounting software. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Bills.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Bills.cs index 392dddda8..9230c0178 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Bills.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Bills.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class Bills { - [JsonProperty("results")] public List? Results { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhook.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhook.cs deleted file mode 100644 index 3f9c29e30..000000000 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhook.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// -// Changes to this file may cause incorrect behavior and will be lost when -// the code is regenerated. -// -//------------------------------------------------------------------------------ -#nullable enable -namespace Codat.Sync.Payables.Models.Components -{ - using Codat.Sync.Payables.Models.Components; - using Codat.Sync.Payables.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body for a client that has reached their rate limit. - /// - public class ClientRateLimitReachedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public ClientRateLimitReachedWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhookData.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhookData.cs deleted file mode 100644 index 2743e9d4e..000000000 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitReachedWebhookData.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// -// Changes to this file may cause incorrect behavior and will be lost when -// the code is regenerated. -// -//------------------------------------------------------------------------------ -#nullable enable -namespace Codat.Sync.Payables.Models.Components -{ - using Codat.Sync.Payables.Utils; - using Newtonsoft.Json; - - public class ClientRateLimitReachedWebhookData - { - - /// - /// The number of available requests per day. - /// - [JsonProperty("DailyQuota")] - public long? DailyQuota { get; set; } - - /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// - ///
- /// ```
- /// 2020-10-08T22:40:50Z
- /// 2021-01-01T00:00:00
- /// ```
- ///
- ///
- ///
- /// When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:
- ///
- /// - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- /// - Unqualified local time: `2021-11-15T01:00:00`
- /// - UTC time offsets: `2021-11-15T01:00:00-05:00`
- ///
- /// > Time zones
- /// >
- /// > Not all dates from Codat will contain information about time zones.
- /// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
- ///
- [JsonProperty("ExpiresUtc")] - public string? ExpiresUtc { get; set; } - } -} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhook.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhook.cs deleted file mode 100644 index 9d26fbf33..000000000 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhook.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// -// Changes to this file may cause incorrect behavior and will be lost when -// the code is regenerated. -// -//------------------------------------------------------------------------------ -#nullable enable -namespace Codat.Sync.Payables.Models.Components -{ - using Codat.Sync.Payables.Models.Components; - using Codat.Sync.Payables.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body for a client that has had their rate limit reset. - /// - public class ClientRateLimitResetWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public ClientRateLimitResetWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhookData.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhookData.cs deleted file mode 100644 index 6cea8472d..000000000 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitResetWebhookData.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// -// Changes to this file may cause incorrect behavior and will be lost when -// the code is regenerated. -// -//------------------------------------------------------------------------------ -#nullable enable -namespace Codat.Sync.Payables.Models.Components -{ - using Codat.Sync.Payables.Utils; - using Newtonsoft.Json; - - public class ClientRateLimitResetWebhookData - { - - /// - /// Total number of requests remaining for your client. - /// - [JsonProperty("QuotaRemaining")] - public long? QuotaRemaining { get; set; } = null; - - /// - /// The reason for your rate limit quota being reset. - /// - [JsonProperty("ResetReason")] - public string? ResetReason { get; set; } - - /// - /// The number of available requests per day. - /// - [JsonProperty("DailyQuota")] - public long? DailyQuota { get; set; } - - /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// - ///
- /// ```
- /// 2020-10-08T22:40:50Z
- /// 2021-01-01T00:00:00
- /// ```
- ///
- ///
- ///
- /// When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:
- ///
- /// - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- /// - Unqualified local time: `2021-11-15T01:00:00`
- /// - UTC time offsets: `2021-11-15T01:00:00-05:00`
- ///
- /// > Time zones
- /// >
- /// > Not all dates from Codat will contain information about time zones.
- /// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
- ///
- [JsonProperty("ExpiresUtc")] - public string? ExpiresUtc { get; set; } - } -} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs index dfca24cb1..93fb16b37 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhook.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class ClientRateLimitWebhook { - /// /// Unique identifier of the event. /// @@ -29,9 +28,7 @@ public class ClientRateLimitWebhook public string? EventType { get; set; } /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -50,7 +47,6 @@ public class ClientRateLimitWebhook /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("generatedDate")] public string? GeneratedDate { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs index 3eb219f88..7ae2d02df 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/ClientRateLimitWebhookPayload.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class ClientRateLimitWebhookPayload { - /// /// The number of available requests per day. /// @@ -28,9 +27,7 @@ public class ClientRateLimitWebhookPayload public long? QuotaRemaining { get; set; } /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -49,7 +46,6 @@ public class ClientRateLimitWebhookPayload /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("expiryDate")] public string? ExpiryDate { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/CodatFile.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/CodatFile.cs index 078c26701..3904e5b47 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/CodatFile.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/CodatFile.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; - + public class CodatFile { - [SpeakeasyMetadata("multipartForm:name=fileName")] public string FileName { get; set; } = default!; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Companies.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Companies.cs index b822d5a6c..ef8f2dce0 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Companies.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Companies.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class Companies { - [JsonProperty("results")] public List? Results { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Company.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Company.cs index 90e9eb5a2..baecfff53 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Company.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Company.cs @@ -13,20 +13,16 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// /// In Codat, a company represents a business sharing access to their data. Each company can have multiple connections 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.
- /// - /// ///
/// 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. - ///
///
public class Company { - /// /// Unique identifier for your SMB in Codat. /// @@ -34,7 +30,7 @@ public class Company public string Id { get; set; } = default!; /// - /// The name of the company + /// The name of the company. /// [JsonProperty("name")] public string Name { get; set; } = default!; @@ -52,9 +48,7 @@ public class Company public string Redirect { get; set; } = default!; /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -73,15 +67,12 @@ public class Company /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("lastSync")] public string? LastSync { get; set; } /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -100,7 +91,6 @@ public class Company /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("created")] public string? Created { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyInformation.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyInformation.cs index 7f7b63c0e..33c300797 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyInformation.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyInformation.cs @@ -11,13 +11,12 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// /// Gets the latest basic info for a company. /// public class CompanyInformation { - /// /// Name of the linked company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReference.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReference.cs index 0fa8a3cd9..9bd813b3c 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReference.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReference.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class CompanyReference { - /// /// Unique identifier for your SMB in Codat. /// @@ -24,7 +23,7 @@ public class CompanyReference public string? Id { get; set; } /// - /// The name of the company + /// The name of the company. /// [JsonProperty("name")] public string? Name { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs index 0d27d09e5..0b7c6feba 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyReferenceLinks.cs @@ -11,13 +11,12 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// /// A collection of links for the company. /// public class CompanyReferenceLinks { - /// /// Link to the company page in the portal. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs index 5b3fa86e4..072912778 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyRequestBody.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class CompanyRequestBody { - /// /// Name of company being connected. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyUpdateRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyUpdateRequest.cs new file mode 100644 index 000000000..b3602add1 --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/CompanyUpdateRequest.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables.Models.Components +{ + using Codat.Sync.Payables.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + public class CompanyUpdateRequest + { + /// + /// Name of company being connected. + /// + [JsonProperty("name")] + public string? Name { get; set; } + + /// + /// Additional information about the company. This can be used to store foreign IDs, references, etc. + /// + [JsonProperty("description")] + public string? Description { get; set; } + + /// + /// A collection of user-defined key-value pairs that store custom metadata against the company. + /// + [JsonProperty("tags")] + public Dictionary? Tags { get; set; } + } +} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Connection.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Connection.cs index 2a5182004..94b8aadc2 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Connection.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Connection.cs @@ -13,11 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// - /// A connection represents a company's connection to a data source and allows you to synchronize data (pull and/or push) with that source.
- /// - /// + /// A connection represents a company's 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:
///
@@ -27,13 +25,11 @@ namespace Codat.Sync.Payables.Models.Components /// 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. - ///
///
public class Connection { - /// - /// Unique identifier for a company's data connection. + /// Unique identifier for a company's data connection. /// [JsonProperty("id")] public string Id { get; set; } = default!; @@ -45,7 +41,7 @@ public class Connection public string IntegrationId { get; set; } = default!; /// - /// 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. + /// 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. /// [JsonProperty("integrationKey")] public string IntegrationKey { get; set; } = default!; @@ -81,9 +77,7 @@ public class Connection public DataConnectionStatus Status { get; set; } = default!; /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -102,15 +96,12 @@ public class Connection /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("lastSync")] public string? LastSync { get; set; } /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -129,7 +120,6 @@ public class Connection /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("created")] public string Created { get; set; } = default!; @@ -138,6 +128,6 @@ public class Connection public List? DataConnectionErrors { get; set; } = null; [JsonProperty("connectionInfo")] - public Dictionary? ConnectionInfo { get; set; } = null; + public Dictionary? ConnectionInfo { get; set; } = null; } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Connections.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Connections.cs index 12425917f..034beb101 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Connections.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Connections.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class Connections { - [JsonProperty("results")] public List? Results { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionError.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionError.cs index 43ff4d1f7..8ded51053 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionError.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionError.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class DataConnectionError { - /// /// The HTTP status code returned by the source platform when the error occurred. /// @@ -35,9 +34,7 @@ public class DataConnectionError public string? ErrorMessage { get; set; } /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -56,7 +53,6 @@ public class DataConnectionError /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("erroredOnUtc")] public string? ErroredOnUtc { get; set; } @@ -68,9 +64,7 @@ public class DataConnectionError public ErrorStatus? Status { get; set; } = null; /// - /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
- /// - /// + /// In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:
///
/// ```
/// 2020-10-08T22:40:50Z
@@ -89,7 +83,6 @@ public class DataConnectionError /// >
/// > Not all dates from Codat will contain information about time zones.
/// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - ///
///
[JsonProperty("resolvedOnUtc")] public string? ResolvedOnUtc { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs index 0a7cd9dc9..43ee3e03d 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/DataConnectionStatus.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// The current authorization status of the data connection. /// @@ -60,5 +60,4 @@ public static DataConnectionStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum DataConnectionStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/DataType.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/DataType.cs new file mode 100644 index 000000000..adff43f1f --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/DataType.cs @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables.Models.Components +{ + using Codat.Sync.Payables.Utils; + using Newtonsoft.Json; + using System; + + /// + /// The type of the linked reference. + /// + public enum DataType + { + [JsonProperty("trackingCategories")] + TrackingCategories, + [JsonProperty("customers")] + Customers, + } + + public static class DataTypeExtension + { + public static string Value(this DataType value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static DataType ToEnum(this string value) + { + foreach(var field in typeof(DataType).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is DataType) + { + return (DataType)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum DataType"); + } + } +} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorStatus.cs index d10b0d214..edc3e7691 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorStatus.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// The current status of a transient error. Null statuses indicate that the error is not transient. /// @@ -56,5 +56,4 @@ public static ErrorStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum ErrorStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidation.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidation.cs index 90ba66aa3..ac95111c3 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidation.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidation.cs @@ -13,13 +13,12 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// /// A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. /// public class ErrorValidation { - [JsonProperty("errors")] public List? Errors { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs index 56312baef..a375891c3 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/ErrorValidationItem.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class ErrorValidationItem { - /// /// Unique identifier for a validation item. /// @@ -22,7 +21,7 @@ public class ErrorValidationItem public string? ItemId { get; set; } = null; /// - /// A message outlining validation item's issue. + /// A message outlining validation item's issue. /// [JsonProperty("message")] public string? Message { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/HalRef.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/HalRef.cs index 3a42a7d50..17a6f0c66 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/HalRef.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/HalRef.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class HalRef { - /// /// Uri hypertext reference. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Links.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Links.cs index 7925bafa8..e0b9c428d 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Links.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Links.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class Links { - [JsonProperty("self")] public HalRef Self { get; set; } = default!; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Pagination.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Pagination.cs index f997260da..06f3589c4 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Pagination.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Pagination.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class 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. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs index 9b5f024c8..34cfdfc03 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/PaymentMappingOptions.cs @@ -13,15 +13,14 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// - /// Gets the bill payments mapping options for a company's accounting software + /// Gets the bill payments mapping options for a company's accounting software. /// public class PaymentMappingOptions { - [JsonProperty("bankAccounts")] - public List? BankAccounts { get; set; } + public List? BankAccounts { get; set; } [JsonProperty("pagination")] public Pagination? Pagination { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Security.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Security.cs index b43850397..a593417b4 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Security.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Security.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; - + public class Security { - [SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=header,name=Authorization")] public string AuthHeader { get; set; } = default!; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/SourceType.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/SourceType.cs index 043fdf996..5a51c7769 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/SourceType.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/SourceType.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// The type of platform of the connection. /// @@ -66,5 +66,4 @@ public static SourceType ToEnum(this string value) throw new Exception($"Unknown value {value} for enum SourceType"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Supplier.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Supplier.cs index 0b4e0fec6..fc9c61314 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Supplier.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Supplier.cs @@ -13,19 +13,14 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + /// /// Suppliers are people or organizations that provide something, such as a product or service. Use the List suppliers endpoint to retrieve a list of all suppliers for a company.
- /// - /// ///
- /// Suppliers' data links to accounts payable bills.
- /// - ///
+ /// Suppliers' data links to accounts payable bills. ///
public class Supplier { - /// /// Identifier for the supplier, unique to the company in the accounting software. /// @@ -75,7 +70,7 @@ public class Supplier public decimal? Balance { get; set; } = null; /// - /// Default currency the supplier's transactional data is recorded in. + /// Default currency the supplier's transactional data is recorded in. /// [JsonProperty("defaultCurrency")] public string? DefaultCurrency { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierPrototype.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierPrototype.cs index f0a5c9bd0..37c9ddc38 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierPrototype.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierPrototype.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class SupplierPrototype { - /// /// Name of the supplier as recorded in the accounting system, typically the company name. /// @@ -60,7 +59,7 @@ public class SupplierPrototype public decimal? Balance { get; set; } = null; /// - /// Default currency the supplier's transactional data is recorded in. + /// Default currency the supplier's transactional data is recorded in. /// [JsonProperty("defaultCurrency")] public string? DefaultCurrency { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierRef.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierRef.cs index 2385880d2..fae913e8f 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierRef.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierRef.cs @@ -11,21 +11,20 @@ namespace Codat.Sync.Payables.Models.Components { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + /// /// Reference to the supplier the record relates to. /// public class SupplierRef { - /// - /// The supplier's unique ID + /// The supplier's unique ID. /// [JsonProperty("id")] public string Id { get; set; } = default!; /// - /// The supplier's name + /// The supplier's name. /// [JsonProperty("supplierName")] public string? SupplierName { get; set; } = null; diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierStatus.cs index 299532e1f..2067fda98 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/SupplierStatus.cs @@ -12,7 +12,7 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// Status of the supplier. /// @@ -58,5 +58,4 @@ public static SupplierStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum SupplierStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/Suppliers.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/Suppliers.cs index 92926882e..da91a741c 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/Suppliers.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/Suppliers.cs @@ -13,10 +13,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System.Collections.Generic; - + public class Suppliers { - [JsonProperty("results")] public List? Results { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs index fc863c8b3..a04fb5fae 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateMappingOption.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class TaxRateMappingOption { - /// /// Identifier for the tax rate, unique for the company in the accounting software. /// @@ -48,11 +47,8 @@ public class TaxRateMappingOption /// /// 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. - ///
+ /// - `Archived` - A tax rate that has been archived or is inactive in the accounting software. ///
[JsonProperty("status")] public TaxRateStatus? Status { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateStatus.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateStatus.cs index a4e18529d..99db1749b 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateStatus.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/TaxRateStatus.cs @@ -12,14 +12,11 @@ namespace Codat.Sync.Payables.Models.Components using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - + /// /// 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. - ///
+ /// - `Archived` - A tax rate that has been archived or is inactive in the accounting software. ///
public enum TaxRateStatus { @@ -61,5 +58,4 @@ public static TaxRateStatus ToEnum(this string value) throw new Exception($"Unknown value {value} for enum TaxRateStatus"); } } - } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Components/TrackingRef.cs b/sync-for-payables/Codat/Sync/Payables/Models/Components/TrackingRef.cs new file mode 100644 index 000000000..73e954ff0 --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Components/TrackingRef.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables.Models.Components +{ + using Codat.Sync.Payables.Models.Components; + using Codat.Sync.Payables.Utils; + using Newtonsoft.Json; + + public class TrackingRef + { + /// + /// Unique identifier of the linked tracking category or the unique identifier of the linked customer. + /// + [JsonProperty("id")] + public string? Id { get; set; } + + /// + /// The type of the linked reference. + /// + [JsonProperty("dataType")] + public DataType? DataType { get; set; } + + /// + /// 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. + /// + [JsonProperty("isBillable")] + public bool? IsBillable { get; set; } + } +} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs b/sync-for-payables/Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs new file mode 100644 index 000000000..d1a1881ae --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#nullable enable +namespace Codat.Sync.Payables.Models.Errors +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + + /// + /// Base Exception for API Errors. + /// + public class CodatSyncPayablesException : Exception + { + /// + /// Error Message + /// + public override string Message { get; } + + /// + /// HTTP status code + /// + public int StatusCode { get; } + + /// + /// HTTP headers + /// + public HttpResponseHeaders Headers { get; } + + /// + /// HTTP content type + /// + public string? ContentType { get; } + + /// + /// Raw response + /// + public HttpResponseMessage RawResponse { get; } + + /// + /// HTTP response body + /// + public string Body { get; } + + public CodatSyncPayablesException( + string message, + HttpResponseMessage rawResponse, + string body + ) : this(message, rawResponse, body, null) {} + + public CodatSyncPayablesException( + string message, + HttpResponseMessage rawResponse, + string body, + Exception? innerException + ) : base(message, innerException) + { + Message = message; + RawResponse = rawResponse; + StatusCode = (int)rawResponse.StatusCode; + Headers = rawResponse.Headers; + ContentType = rawResponse.Content.Headers.ContentType?.MediaType; + Body = body; + } + + /// + /// Detailed Error Message + /// + public override string ToString() + { + var innerMessage = string.IsNullOrEmpty(InnerException?.Message) ? "" : $"\n{InnerException.Message}"; + return $"Status: {StatusCode}. {Message}{innerMessage}"; + } + + } +} diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Errors/ErrorMessage.cs b/sync-for-payables/Codat/Sync/Payables/Models/Errors/ErrorMessage.cs index b77bcb1ba..2aeef89b4 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Errors/ErrorMessage.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Errors/ErrorMessage.cs @@ -13,13 +13,10 @@ namespace Codat.Sync.Payables.Models.Errors using Codat.Sync.Payables.Utils; using Newtonsoft.Json; using System; - - /// - /// Your `query` parameter was not correctly formed - /// - public class ErrorMessage : Exception - { + using System.Net.Http; + public class ErrorMessagePayload + { /// /// The HTTP status code returned by the error. /// @@ -27,7 +24,7 @@ public class ErrorMessage : Exception public long? StatusCode { get; set; } /// - /// Codat's service the returned the error. + /// Codat's service the returned the error. /// [JsonProperty("service")] public string? Service { get; set; } @@ -62,4 +59,51 @@ public class ErrorMessage : Exception [JsonProperty("detailedErrorCode")] public long? DetailedErrorCode { get; set; } } + + /// + /// Your `query` parameter was not correctly formed. + /// + public class ErrorMessage : CodatSyncPayablesException + { + /// + /// The original data that was passed to this exception. + /// + public ErrorMessagePayload Payload { get; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.Service instead.")] + public string? Service { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.Error instead.")] + public string? Error { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.CorrelationId instead.")] + public string? CorrelationId { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.Validation instead.")] + public ErrorValidation? Validation { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.CanBeRetried instead.")] + public string? CanBeRetried { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.DetailedErrorCode instead.")] + public long? DetailedErrorCode { get; set; } + + public ErrorMessage( + ErrorMessagePayload payload, + HttpResponseMessage rawResponse, + string body + ): base("API error occurred", rawResponse, body) + { + Payload = payload; + + #pragma warning disable CS0618 + Service = payload.Service; + Error = payload.Error; + CorrelationId = payload.CorrelationId; + Validation = payload.Validation; + CanBeRetried = payload.CanBeRetried; + DetailedErrorCode = payload.DetailedErrorCode; + #pragma warning restore CS0618 + } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Errors/ResponseValidationException.cs b/sync-for-payables/Codat/Sync/Payables/Models/Errors/ResponseValidationException.cs new file mode 100644 index 000000000..c0c570f6e --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Errors/ResponseValidationException.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#nullable enable +namespace Codat.Sync.Payables.Models.Errors +{ + using System; + using System.Net.Http; + + /// + /// Raised if the response data could not be deserialized into the expected model. + /// + public class ResponseValidationException : CodatSyncPayablesException + { + + public ResponseValidationException( + string message, + HttpResponseMessage rawResponse, + string body, + Exception innerException + ): base(message, rawResponse, body, innerException) {} + } +} diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Errors/SDKException.cs b/sync-for-payables/Codat/Sync/Payables/Models/Errors/SDKException.cs index c40628bc9..e5c1e3d9b 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Errors/SDKException.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Errors/SDKException.cs @@ -6,36 +6,25 @@ // the code is regenerated. // //------------------------------------------------------------------------------ + #nullable enable namespace Codat.Sync.Payables.Models.Errors { using System; using System.Net.Http; - public class SDKException : Exception + /// + /// Default API Exception. + /// + public class SDKException : CodatSyncPayablesException { - - public override string Message { get; } - public int StatusCode { get; set; } - public string Body { get; set; } - public HttpResponseMessage RawResponse { get; set; } = default!; - public SDKException(string message, int statusCode, string body, HttpResponseMessage rawResponse) - { - Message = message; - this.StatusCode = statusCode; - StatusCode = statusCode; - Body = body; - RawResponse = rawResponse; - } - - public override string ToString(){ - var body = ""; - if (Body.Length > 0) - { - body += $"\n{Body}"; - } - return Message + ": Status " + StatusCode + body; - } - + /// + /// Default API exception. + /// + public SDKException( + string message, + HttpResponseMessage rawResponse, + string body + ): base(message, rawResponse, body) {} } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs index de92077f0..78d5d0836 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class CreateBankAccountRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs index 5a17ad964..ebfd1fc4a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBankAccountResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class CreateBankAccountResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Created + /// Created. /// public BankAccount? BankAccount { get; set; } = null; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs index e308336eb..e75f00e99 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class CreateBillPaymentRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs index 388f55b24..2b591743b 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillPaymentResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class CreateBillPaymentResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Created + /// Created. /// public BillPayment? BillPayment { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs index d0d6d4b2a..ee8e80db2 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class CreateBillRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs index 4bfe75ca2..b8f9e3fbb 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateBillResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class CreateBillResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Created + /// Created. /// public Bill? Bill { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs index b346a65cf..1e07cbf7e 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateCompanyResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class CreateCompanyResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Company? Company { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs index 5c15f0454..ee2807dab 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Utils; - + public class CreateConnectionRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs index 638e8409f..1bbae574b 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionRequestBody.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class CreateConnectionRequestBody { - /// /// A unique 4-letter key to represent a platform in each integration. View accounting, banking, and commerce platform keys. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs index d5d5161c5..49bde8f5f 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateConnectionResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class CreateConnectionResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Connection? Connection { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs index 3c83caf1f..8c024b197 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class CreateSupplierRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs index a78136302..1fcc8c857 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/CreateSupplierResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class CreateSupplierResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Created + /// Created. /// public Supplier? Supplier { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs index 6dab6b06c..f1aff709e 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class DeleteCompanyRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs index 9d6be9809..7a9f703bd 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteCompanyResponse.cs @@ -10,24 +10,23 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class DeleteCompanyResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs index 5e7f3210e..63de094c1 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class DeleteConnectionRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs index b9c547c75..e94108f9c 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DeleteConnectionResponse.cs @@ -10,24 +10,23 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class DeleteConnectionResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs index 3f63a673a..b302d3c9a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class DownloadBillAttachmentRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs index 6b54706b5..a4f910ff7 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/DownloadBillAttachmentResponse.cs @@ -10,29 +10,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class DownloadBillAttachmentResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public byte[]? Data { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs index 429764cf5..a76045a22 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class GetCompanyInformationRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs index 161c6fe5d..81778afe6 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyInformationResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class GetCompanyInformationResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public Models.Components.CompanyInformation? CompanyInformation { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs index 96d2f4761..b90933e05 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class GetCompanyRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs index 4b2e28dbd..989859233 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetCompanyResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class GetCompanyResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Company? Company { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs index 1d8dec3f3..10c389d64 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class GetConnectionRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs index 97ce8de52..7b2791bdd 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetConnectionResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class GetConnectionResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Connection? Connection { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs index c876b1a9a..84c8235c2 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class GetMappingOptionsBillsRequest { - /// /// Unique identifier for a company. /// @@ -33,7 +32,7 @@ public class GetMappingOptionsBillsRequest public string? ContinuationToken { get; set; } /// - /// Codat query string allows you to filter by `status` (`status=Active||status=Archived`). Learn more about Codat's query string. + /// Codat query string allows you to filter by `status` (`status=Active||status=Archived`). Learn more about Codat's query string. /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=statusQuery")] public string? StatusQuery { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs index 862653e80..ef9071950 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsBillsResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class GetMappingOptionsBillsResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public BillMappingOptions? BillMappingOptions { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs index 29f1ed5e9..2f3ee441e 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class GetMappingOptionsPaymentsRequest { - /// /// Unique identifier for a company. /// @@ -33,7 +32,7 @@ public class GetMappingOptionsPaymentsRequest public string? ContinuationToken { get; set; } /// - /// Codat query string allows you to filter by `status` (`status=Active||status=Archived`). Learn more about Codat's query string. + /// Codat query string allows you to filter by `status` (`status=Active||status=Archived`). Learn more about Codat's query string. /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=statusQuery")] public string? StatusQuery { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs index ff0605bff..a76a75dea 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/GetMappingOptionsPaymentsResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class GetMappingOptionsPaymentsResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public PaymentMappingOptions? PaymentMappingOptions { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs index 198ca4165..fb7d079bc 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class ListBillAttachmentsRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs index ef6577d2e..36cb1453f 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillAttachmentsResponse.cs @@ -11,30 +11,29 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; + using System; using System.Collections.Generic; using System.Net.Http; - using System; - + public class ListBillAttachmentsResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public List? Attachments { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs index ed81ee7ef..4ae146042 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class ListBillsRequest { - /// /// Unique identifier for a company. /// @@ -33,7 +32,7 @@ public class ListBillsRequest public string? ContinuationToken { get; set; } /// - /// Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat's query string here. Platfrom specfic statuses: Xero supports Open | PartiallyPaid | Paid | Void | Draft. Qbo supports Open | PartiallyPaid | Paid. FreeAgent supports Open | PartiallyPaid | Paid. + /// Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat's query string here. Platfrom specfic statuses: Xero supports Open | PartiallyPaid | Paid | Void | Draft. Qbo supports Open | PartiallyPaid | Paid. FreeAgent supports Open | PartiallyPaid | Paid. /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")] public string? Query { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs index 8b8a45504..e5d6a5ccc 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListBillsResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class ListBillsResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public Models.Components.Bills? Bills { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs index 41e53afb7..4d07d3027 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class ListCompaniesRequest { - /// /// Page number. Read more. /// @@ -37,5 +36,11 @@ public class ListCompaniesRequest /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy")] public string? OrderBy { get; set; } + + /// + /// Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with Codat’s query language. + /// + [SpeakeasyMetadata("queryParam:style=form,explode=true,name=tags")] + public string? Tags { get; set; } } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs index 0f9e60350..e77ce184b 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListCompaniesResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class ListCompaniesResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Models.Components.Companies? Companies { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs index 9d1fcf3d0..35358c7fc 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class ListConnectionsRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs index d649ed95e..602fcee93 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListConnectionsResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class ListConnectionsResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Models.Components.Connections? Connections { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs index 877655dad..2a6ad8d2a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersRequest.cs @@ -10,10 +10,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Utils; - + public class ListSuppliersRequest { - /// /// Unique identifier for a company. /// @@ -33,7 +32,7 @@ public class ListSuppliersRequest public string? ContinuationToken { get; set; } /// - /// 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. + /// 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. /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")] public string? Query { get; set; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs index 6a903c402..9bb7c3334 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ListSuppliersResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class ListSuppliersResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Success + /// Success. /// public Models.Components.Suppliers? Suppliers { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyRequest.cs new file mode 100644 index 000000000..e20d96594 --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyRequest.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables.Models.Requests +{ + using Codat.Sync.Payables.Models.Components; + using Codat.Sync.Payables.Utils; + + public class ReplaceCompanyRequest + { + /// + /// Unique identifier for a company. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")] + public string CompanyId { get; set; } = default!; + + [SpeakeasyMetadata("request:mediaType=application/json")] + public CompanyRequestBody? CompanyRequestBody { get; set; } + } +} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse1.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyResponse.cs similarity index 70% rename from sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse1.cs rename to sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyResponse.cs index 3b6a9007f..cb5f0c9da 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse1.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/ReplaceCompanyResponse.cs @@ -7,28 +7,33 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Codat.Sync.Payables.Models.Webhooks +namespace Codat.Sync.Payables.Models.Requests { + using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - - public class ClientRateLimitReachedResponse1 - { + using System.Net.Http; + public class ReplaceCompanyResponse + { /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// OK. + /// + public Company? Company { get; set; } } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs index bb3725304..22bccf884 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Utils; - + public class UnlinkConnectionRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs index 6b739d007..b6140adae 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class UnlinkConnectionResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Connection? Connection { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs index 9e8842a5c..f88f479ca 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UnlinkConnectionUpdateConnection.cs @@ -12,10 +12,9 @@ namespace Codat.Sync.Payables.Models.Requests using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; using Newtonsoft.Json; - + public class UnlinkConnectionUpdateConnection { - /// /// The current authorization status of the data connection. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillRequest.cs new file mode 100644 index 000000000..a92bc49d5 --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillRequest.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables.Models.Requests +{ + using Codat.Sync.Payables.Models.Components; + using Codat.Sync.Payables.Utils; + + public class UpdateBillRequest + { + /// + /// Unique identifier for a company. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")] + public string CompanyId { get; set; } = default!; + + /// + /// Unique identifier for a connection. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=connectionId")] + public string ConnectionId { get; set; } = default!; + + /// + /// Unique identifier for a bill. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billId")] + public string BillId { get; set; } = default!; + + /// + /// A unique identifier to ensure idempotent behaviour for subsequent requests. + /// + [SpeakeasyMetadata("header:style=simple,explode=false,name=Idempotency-Key")] + public string? IdempotencyKey { get; set; } + + [SpeakeasyMetadata("request:mediaType=application/json")] + public BillPrototype? BillPrototype { get; set; } + } +} \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse1.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillResponse.cs similarity index 71% rename from sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse1.cs rename to sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillResponse.cs index b40ac9308..3eb163711 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse1.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateBillResponse.cs @@ -7,28 +7,33 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Codat.Sync.Payables.Models.Webhooks +namespace Codat.Sync.Payables.Models.Requests { + using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - - public class ClientRateLimitResetResponse1 - { + using System.Net.Http; + public class UpdateBillResponse + { /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// Success. + /// + public Bill? Bill { get; set; } } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs index b4455d8b1..609169e1a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class UpdateCompanyRequest { - /// /// Unique identifier for a company. /// @@ -22,6 +21,6 @@ public class UpdateCompanyRequest public string CompanyId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public CompanyRequestBody? CompanyRequestBody { get; set; } + public CompanyUpdateRequest? CompanyUpdateRequest { get; set; } } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs index 9cd1f4a6a..08c1c63aa 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UpdateCompanyResponse.cs @@ -11,29 +11,28 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class UpdateCompanyResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// OK. /// public Company? Company { get; set; } } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs index 3457fde9f..919892415 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentRequest.cs @@ -11,10 +11,9 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - + public class UploadBillAttachmentRequest { - /// /// Unique identifier for a company. /// diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs index 0adde0501..838b8b587 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Requests/UploadBillAttachmentResponse.cs @@ -11,30 +11,29 @@ namespace Codat.Sync.Payables.Models.Requests { using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class UploadBillAttachmentResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// Created + /// Created. /// - public Attachment? Attachment { get; set; } = null; + public Attachment? Attachment { get; set; } } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs index d4e285e71..791d143e5 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitReachedResponse.cs @@ -10,24 +10,23 @@ namespace Codat.Sync.Payables.Models.Webhooks { using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class ClientRateLimitReachedResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; } diff --git a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs b/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs index b4d647b14..1eb9db127 100644 --- a/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs +++ b/sync-for-payables/Codat/Sync/Payables/Models/Webhooks/ClientRateLimitResetResponse.cs @@ -10,24 +10,23 @@ namespace Codat.Sync.Payables.Models.Webhooks { using Codat.Sync.Payables.Utils; - using System.Net.Http; using System; - + using System.Net.Http; + public class ClientRateLimitResetResponse { - /// - /// HTTP response content type for this operation + /// HTTP response content type for this operation. /// public string? ContentType { get; set; } = default!; /// - /// HTTP response status code for this operation + /// HTTP response status code for this operation. /// public int StatusCode { get; set; } = default!; /// - /// Raw HTTP response; suitable for custom response parsing + /// Raw HTTP response; suitable for custom response parsing. /// public HttpResponseMessage RawResponse { get; set; } = default!; } diff --git a/sync-for-payables/Codat/Sync/Payables/SDKConfig.cs b/sync-for-payables/Codat/Sync/Payables/SDKConfig.cs new file mode 100644 index 000000000..943101aea --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/SDKConfig.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables +{ + using Codat.Sync.Payables.Hooks; + using Codat.Sync.Payables.Models.Components; + using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// Main configuration for the SDK. + /// + public struct SDKConfig + { + /// + /// List of server URLs available to the SDK. + /// + public static readonly string[] ServerList = { + "https://api.codat.io", + }; + + public ISpeakeasyHttpClient Client; + public string ServerUrl; + public int ServerIndex; + public string UserAgent; + public Func? SecuritySource; + public SDKHooks Hooks; + public RetryConfig? RetryConfig; + + /// + /// Initializes a new instance of the SDKConfig struct with default values. + /// + public SDKConfig(ISpeakeasyHttpClient? client = null) + { + Client = client ?? new SpeakeasyHttpClient(); + ServerUrl = ""; + ServerIndex = 0; + UserAgent = "speakeasy-sdk/csharp 10.1.0 2.812.2 3.0.0 Codat.Sync.Payables"; + SecuritySource = null; + Hooks = new SDKHooks(); + RetryConfig = null; + } + + public string GetTemplatedServerUrl() + { + if (!String.IsNullOrEmpty(this.ServerUrl)) + { + return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); + } + return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary()); + } + } +} diff --git a/sync-for-payables/Codat/Sync/Payables/Suppliers.cs b/sync-for-payables/Codat/Sync/Payables/Suppliers.cs index fff34ac38..748840ba0 100644 --- a/sync-for-payables/Codat/Sync/Payables/Suppliers.cs +++ b/sync-for-payables/Codat/Sync/Payables/Suppliers.cs @@ -13,26 +13,25 @@ namespace Codat.Sync.Payables using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Errors; using Codat.Sync.Payables.Models.Requests; - using Codat.Sync.Payables.Utils.Retries; using Codat.Sync.Payables.Utils; + using Codat.Sync.Payables.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Get, create, and update Suppliers. /// public interface ISuppliers { - /// - /// List suppliers - /// + /// List suppliers. + /// /// - /// The *List suppliers* endpoint returns a list of suppliers for a given company's connection.
+ /// The *List suppliers* endpoint returns a list of suppliers for a given company's connection.
///
/// Suppliers are people or organizations that provide something, such as a product or service.
///
@@ -40,20 +39,33 @@ public interface ISuppliers ///
/// 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`. ///
- /// - Task ListAsync(ListSuppliersRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task ListAsync(ListSuppliersRequest request, RetryConfig? retryConfig = null); /// - /// Create supplier - /// + /// Create supplier. + /// /// - /// The *Create supplier* endpoint creates a new supplier for a given company's connection.
+ /// The *Create supplier* endpoint creates a new supplier for a given company's connection.
///
- /// Suppliers are people or organizations that provide something, such as a product or service.
- /// + /// Suppliers are people or organizations that provide something, such as a product or service. ///
- /// - Task CreateAsync(CreateSupplierRequest request, RetryConfig? retryConfig = null); + /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public Task CreateAsync(CreateSupplierRequest request, RetryConfig? retryConfig = null); } /// @@ -61,38 +73,56 @@ public interface ISuppliers /// public class Suppliers: ISuppliers { + /// + /// SDK Configuration. + /// + /// public SDKConfig SDKConfiguration { get; private set; } - private const string _language = "csharp"; - private const string _sdkVersion = "10.0.0"; - private const string _sdkGenVersion = "2.463.0"; - private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 10.0.0 2.463.0 3.0.0 Codat.Sync.Payables"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - - public Suppliers(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + + public Suppliers(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task ListAsync(ListSuppliersRequest request, RetryConfig? retryConfig = null) + /// + /// List suppliers. + /// + /// + /// The *List suppliers* endpoint returns a list of suppliers for a given company's connection.
+ ///
+ /// Suppliers 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 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`. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// Your `query` parameter was not correctly formed. Thrown when the API returns a 400, 401, 402, 403, 404, 409, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task ListAsync( + ListSuppliersRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/suppliers", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/suppliers", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-suppliers", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-suppliers", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -126,8 +156,8 @@ public async Task ListAsync(ListSuppliersRequest request, Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -137,7 +167,7 @@ public async Task ListAsync(ListSuppliersRequest request, httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -167,7 +197,17 @@ public async Task ListAsync(ListSuppliersRequest request, { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Suppliers obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Suppliers.", httpResponse, httpResponseBody, ex); + } + var response = new ListSuppliersResponse() { StatusCode = responseStatusCode, @@ -178,33 +218,89 @@ public async Task ListAsync(ListSuppliersRequest request, return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 409, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task CreateAsync(CreateSupplierRequest request, RetryConfig? retryConfig = null) + + /// + /// Create supplier. + /// + /// + /// The *Create supplier* endpoint creates a new supplier for a given company's connection.
+ ///
+ /// Suppliers are people or organizations that provide something, such as a product or service. + ///
+ /// A parameter. + /// The retry configuration to use for this operation. + /// An awaitable task that returns a response envelope when completed. + /// The required parameter is null. + /// The HTTP request failed due to network issues. + /// The response body could not be deserialized. + /// The request made is not valid. Thrown when the API returns a 400, 401, 402, 403, 404, 429, 500 or 503 response. + /// Default API Exception. Thrown when the API returns a 4XX or 5XX response. + public async Task CreateAsync( + CreateSupplierRequest request, + RetryConfig? retryConfig = null + ) { + if (request == null) throw new ArgumentNullException(nameof(request)); + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/suppliers", request); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/payables/suppliers", request, null); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "SupplierPrototype", "json", false, true); @@ -213,12 +309,12 @@ public async Task CreateAsync(CreateSupplierRequest requ httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-supplier", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-supplier", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -252,8 +348,8 @@ public async Task CreateAsync(CreateSupplierRequest requ Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Sync.Payables.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -263,7 +359,7 @@ public async Task CreateAsync(CreateSupplierRequest requ httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) { var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) @@ -293,7 +389,17 @@ public async Task CreateAsync(CreateSupplierRequest requ { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Supplier obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Supplier.", httpResponse, httpResponseBody, ex); + } + var response = new CreateSupplierResponse() { StatusCode = responseStatusCode, @@ -304,24 +410,59 @@ public async Task CreateAsync(CreateSupplierRequest requ return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + } } \ No newline at end of file diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/Constants.cs b/sync-for-payables/Codat/Sync/Payables/Utils/Constants.cs new file mode 100644 index 000000000..9cb4ab96e --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Utils/Constants.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Sync.Payables.Utils +{ + /// + /// SDK constants for version information and language identification. + /// + public static class Constants + { + /// + /// The language identifier for this SDK. + /// + public const string Language = "csharp"; + + /// + /// The version of the SDK. + /// + public const string SdkVersion = "10.1.0"; + + /// + /// The version of the SDK generator used to create this SDK. + /// + public const string SdkGenVersion = "2.812.2"; + + /// + /// The version of the OpenAPI document used to generate this SDK. + /// + public const string OpenApiDocVersion = "3.0.0"; + } +} + diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/OpenEnumConverter.cs b/sync-for-payables/Codat/Sync/Payables/Utils/OpenEnumConverter.cs new file mode 100644 index 000000000..48486dcc9 --- /dev/null +++ b/sync-for-payables/Codat/Sync/Payables/Utils/OpenEnumConverter.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +using System; +using Newtonsoft.Json; +namespace Codat.Sync.Payables.Utils +{ + internal class OpenEnumConverter : JsonConverter + { + public override bool CanConvert(System.Type objectType) + { + return objectType.GetMethod("Of") != null && objectType.GetMethod("ToString") != null; + } + + public override object? ReadJson( + JsonReader reader, + System.Type objectType, + object? existingValue, + JsonSerializer serializer + ) + { + if (reader.Value == null) + { + return null; + } + + var method = objectType.GetMethod("Of"); + if (method == null) + { + throw new Exception($"Unable to find Of method on {objectType}"); + } + try { + return method.Invoke(null, new[] { reader.Value }); + } catch(System.Reflection.TargetInvocationException e) { + throw new Newtonsoft.Json.JsonSerializationException("Unable to convert value to open enum", e); + } + } + + public override void WriteJson(JsonWriter writer, object? obj, JsonSerializer serializer) + { + if (obj == null) + { + writer.WriteValue("null"); + return; + } + + var valueProp = obj.GetType().GetProperty("Value"); + if (valueProp == null) + { + throw new Exception($"{obj.GetType()} does not have a Value property"); + } + + writer.WriteValue(valueProp.GetValue(obj)); + } + } +} diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/RequestBodySerializer.cs b/sync-for-payables/Codat/Sync/Payables/Utils/RequestBodySerializer.cs index a0bf15655..aeed4914a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/RequestBodySerializer.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/RequestBodySerializer.cs @@ -265,49 +265,44 @@ private static HttpContent SerializeMultipart(object request, string mediaType) if (metadata.File) { - if (!Utilities.IsClass(value)) + if (Utilities.IsList(value)) { - throw new Exception( - "Cannot serialize multipart file from type " + value.GetType().Name - ); - } - - var fileProps = value.GetType().GetProperties(); - - byte[]? content = null; - string fileName = ""; - string fieldName = ""; - - foreach (var fileProp in fileProps) - { - var fileMetadata = fileProp - .GetCustomAttribute() - ?.GetMultipartFormMetadata(); - if ( - fileMetadata == null - || (!fileMetadata.Content && fileMetadata.Name == "") - ) + // Handle array/list of files - similar to how normal lists are handled + foreach (var fileItem in (IList)value) { - continue; - } + if (!Utilities.IsClass(fileItem)) + { + throw new Exception( + "Cannot serialize multipart file from type " + fileItem.GetType().Name + ); + } - if (fileMetadata.Content) - { - content = (byte[]?)fileProp.GetValue(value); - } - else - { - fieldName = fileMetadata.Name ?? fileProp.Name; - fileName = fileProp.GetValue(value)?.ToString() ?? ""; + var fileProps = fileItem.GetType().GetProperties(); + var (fileName, content) = ExtractFileProperties(fileProps, fileItem); + string fieldName = (metadata.Name ?? prop.Name) + "[]"; + + var fileContent = new ByteArrayContent(content); + fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + formData.Add(fileContent, fieldName, fileName); } } - - if (fieldName == "" || fileName == "" || content == null) + else if (Utilities.IsClass(value)) { - throw new Exception("Invalid multipart/form-data file"); + // Handle single file + var fileProps = value.GetType().GetProperties(); + var (fileName, content) = ExtractFileProperties(fileProps, value); + string fieldName = metadata.Name; + + var fileContent = new ByteArrayContent(content); + fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + formData.Add(fileContent, fieldName, fileName); + } + else + { + throw new Exception( + "Cannot serialize multipart file from type " + value.GetType().Name + ); } - - formData.Add(new ByteArrayContent(content), fieldName, fileName); } else if (metadata.Json) { @@ -521,6 +516,42 @@ ref Dictionary> form } } + private static (string fileName, byte[] content) ExtractFileProperties(PropertyInfo[] fileProps, object fileObject) + { + byte[]? content = null; + string fileName = ""; + + foreach (var fileProp in fileProps) + { + var fileMetadata = fileProp + .GetCustomAttribute() + ?.GetMultipartFormMetadata(); + if ( + fileMetadata == null + || (!fileMetadata.Content && fileMetadata.Name == "") + ) + { + continue; + } + + if (fileMetadata.Content) + { + content = (byte[]?)fileProp.GetValue(fileObject); + } + else + { + fileName = fileProp.GetValue(fileObject)?.ToString() ?? ""; + } + } + + if (fileName == "" || content == null) + { + throw new Exception("Invalid multipart/form-data file"); + } + + return (fileName, content); + } + private static PropertyInfo? GetPropertyInfo(object value, string propertyName) { try diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs b/sync-for-payables/Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs index 7382b0104..39876eda8 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/ResponseBodyDeserializer.cs @@ -28,6 +28,16 @@ internal class ResponseBodyDeserializer return JsonConvert.DeserializeObject(json, new JsonSerializerSettings(){ NullValueHandling = nullValueHandling, MissingMemberHandling = missingMemberHandling, Converters = Utilities.GetJsonDeserializers(typeof(T))}); } + public static T DeserializeNotNull(string json, NullValueHandling nullValueHandling=NullValueHandling.Ignore, MissingMemberHandling missingMemberHandling=MissingMemberHandling.Ignore) + { + var result = ResponseBodyDeserializer.Deserialize(json, nullValueHandling, missingMemberHandling); + if (result == null) + { + throw new Exception($"Deserialization error: {typeof(T).Name} cannot be null."); + } + return result!; + } + public sealed class MissingMemberException : Exception { public MissingMemberException() : base("Missing member.") { } diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs b/sync-for-payables/Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs index 1d7263d5b..89a56678a 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/Retries/BackoffStrategy.cs @@ -9,6 +9,9 @@ #nullable enable namespace Codat.Sync.Payables.Utils.Retries { + /// + /// Exponential backoff strategy configuration. + /// public class BackoffStrategy { public readonly long InitialIntervalMs; diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/Retries/Retries.cs b/sync-for-payables/Codat/Sync/Payables/Utils/Retries/Retries.cs index 474f63a57..eb8331889 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/Retries/Retries.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/Retries/Retries.cs @@ -15,12 +15,22 @@ namespace Codat.Sync.Payables.Utils.Retries using System.Threading.Tasks; using Models.Errors; + /// + /// Handles retry logic for HTTP requests with configurable backoff strategies. + /// public class Retries { private Func> action; private RetryConfig retryConfig; private List statusCodes; + /// + /// Initializes a new instance of the class. + /// + /// The HTTP action to execute and potentially retry. + /// The retry configuration specifying strategy and backoff parameters. + /// The list of HTTP status codes that should trigger retries. + /// Thrown when the statusCodes list is empty. public Retries(Func> action, RetryConfig retryConfig, List statusCodes) { this.action = action; @@ -33,11 +43,17 @@ public Retries(Func> action, RetryConfig retryConfig, } } + /// + /// Exception indicating a non-retryable error that should be immediately propagated. + /// public sealed class PermanentException : Exception { public PermanentException(Exception innerException) : base("NonRetryable error.", innerException) { } } + /// + /// Exception indicating a retryable error that may succeed on subsequent attempts. + /// public sealed class RetryableException : Exception { public HttpResponseMessage? Response = null; @@ -49,6 +65,11 @@ public RetryableException(HttpResponseMessage response) { public RetryableException(Exception innerException) : base("An error occurred.", innerException) { } } + /// + /// Executes the configured HTTP action with retry logic based on the retry strategy. + /// + /// The HTTP response message from the successful request. + /// Thrown when the retry strategy is invalid. public async Task Run() { switch(retryConfig.Strategy) { diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/Retries/RetryConfig.cs b/sync-for-payables/Codat/Sync/Payables/Utils/Retries/RetryConfig.cs index 910e7f907..21794a32d 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/Retries/RetryConfig.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/Retries/RetryConfig.cs @@ -11,13 +11,24 @@ namespace Codat.Sync.Payables.Utils.Retries { public class RetryConfig { + /// + /// Available retry strategies. + /// public enum RetryStrategy { + /// Exponential backoff strategy. BACKOFF, + /// Disabled (no retries). NONE } + + /// The retry strategy. public readonly RetryStrategy Strategy; + + /// The backoff strategy configuration (if applicable). public readonly BackoffStrategy? Backoff; + + /// Whether to retry on connection errors. public readonly bool RetryConnectionErrors; /// diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/SecurityMetadata.cs b/sync-for-payables/Codat/Sync/Payables/Utils/SecurityMetadata.cs index dfbfac025..f57cd9776 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/SecurityMetadata.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/SecurityMetadata.cs @@ -196,6 +196,8 @@ object value case "bearer": headerParams.Add(key, Utilities.PrefixBearer(valStr)); break; + case "custom": + break; default: throw new Exception($"Unknown http subType: {schemeMetadata.SubType}"); } diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs b/sync-for-payables/Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs index a555e0e16..5c3627ef8 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/SpeakeasyHttpClient.cs @@ -19,6 +19,9 @@ public interface ISpeakeasyHttpClient /// /// Sends an HTTP request asynchronously. /// + /// + /// When overriding this method, use HttpCompletionOption.ResponseHeadersRead to support streaming response bodies. + /// /// The HTTP request message to send. /// The value of the TResult parameter contains the HTTP response message. Task SendAsync(HttpRequestMessage request); @@ -46,7 +49,7 @@ public SpeakeasyHttpClient() public virtual async Task SendAsync(HttpRequestMessage request) { - return await httpClient.SendAsync(request); + return await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); } public virtual async Task CloneAsync(HttpRequestMessage request) diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/URLBuilder.cs b/sync-for-payables/Codat/Sync/Payables/Utils/URLBuilder.cs index a1798a129..436e7620f 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/URLBuilder.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/URLBuilder.cs @@ -17,7 +17,7 @@ namespace Codat.Sync.Payables.Utils internal static class URLBuilder { - public static string Build(string baseUrl, string relativeUrl, object? request) + public static string Build(string baseUrl, string relativeUrl, object? request, List? allowEmptyValue = null) { var url = baseUrl; @@ -37,7 +37,7 @@ public static string Build(string baseUrl, string relativeUrl, object? request) var parameters = GetPathParameters(request); url = ReplaceParameters(url, parameters); - var queryParams = SerializeQueryParams(TrySerializeQueryParams(request)); + var queryParams = SerializeQueryParams(TrySerializeQueryParams(request, allowEmptyValue)); if (queryParams != "") { url += $"?{queryParams}"; @@ -55,7 +55,7 @@ public static string ReplaceParameters(string url, Dictionary pa { foreach (var key in parameters.Keys) { - url = url.Replace($"{{{key}}}", parameters[key]); + url = url.Replace($"{{{key}}}", Uri.EscapeDataString(parameters[key])); } return url; @@ -68,7 +68,7 @@ public static string SerializeQueryParams(Dictionary> query { foreach (var value in queryParams[key]) { - queries.Add($"{key}={value}"); + queries.Add($"{key}={WebUtility.UrlEncode(Utilities.ToString(value))}"); } } @@ -90,10 +90,6 @@ private static Dictionary GetPathParameters(object? request) { var val = prop.GetValue(request); - if (val == null) - { - continue; - } if (prop.GetCustomAttribute()?.GetRequestMetadata() != null) { @@ -107,6 +103,13 @@ private static Dictionary GetPathParameters(object? request) continue; } + // Handle null values and empty arrays as empty query parameters + if (val == null || (Utilities.IsList(val) && ((IList)val).Count == 0)) + { + parameters.Add(metadata.Name ?? prop.Name, ""); + continue; + } + if (metadata.Serialization != null) { switch (metadata.Serialization) @@ -114,7 +117,7 @@ private static Dictionary GetPathParameters(object? request) case "json": parameters.Add( metadata.Name ?? prop.Name, - WebUtility.UrlEncode(Utilities.SerializeJSON(val)) + Utilities.SerializeJSON(val) ); break; default: @@ -147,7 +150,7 @@ private static Dictionary GetPathParameters(object? request) return parameters; } - private static Dictionary> TrySerializeQueryParams(object? request) + private static Dictionary> TrySerializeQueryParams(object? request, List? allowEmptyValue = null) { var parameters = new Dictionary>(); @@ -161,9 +164,20 @@ private static Dictionary> TrySerializeQueryParams(object? foreach (var prop in props) { var val = prop.GetValue(request); - + var metadata = prop.GetCustomAttribute()?.GetQueryParamMetadata(); + if (val == null) { + // If this parameter is in allowEmptyValue and val is null, include it as empty + if (metadata != null && allowEmptyValue?.Contains(metadata.Name ?? prop.Name) == true) + { + var paramName = metadata.Name ?? prop.Name; + if (!parameters.ContainsKey(paramName)) + { + parameters.Add(paramName, new List()); + } + parameters[paramName].Add(""); + } continue; } @@ -172,7 +186,6 @@ private static Dictionary> TrySerializeQueryParams(object? continue; } - var metadata = prop.GetCustomAttribute()?.GetQueryParamMetadata(); if (metadata == null) { continue; @@ -207,7 +220,8 @@ private static Dictionary> TrySerializeQueryParams(object? metadata.Name ?? prop.Name, val, metadata.Explode, - "," + ",", + allowEmptyValue ); foreach (var key in formParams.Keys) { @@ -245,7 +259,8 @@ private static Dictionary> TrySerializeQueryParams(object? metadata.Name ?? prop.Name, val, metadata.Explode, - "|" + "|", + allowEmptyValue ); foreach (var key in pipeParams.Keys) { @@ -358,7 +373,8 @@ private static Dictionary> SerializeFormQueryParams( string parentName, object value, bool explode, - string delimiter + string delimiter, + List? allowEmptyValue = null ) { var parameters = new Dictionary>(); @@ -458,32 +474,45 @@ string delimiter { var values = new List(); var items = new List(); + var list = (IList)value; - foreach (var item in (IList)value) + // Handle empty arrays - add empty parameter if allowEmptyValue includes this parameter + if (list.Count == 0 && allowEmptyValue?.Contains(parentName) == true) { - if (explode) - { - values.Add(Utilities.ValueToString(item)); - } - else + if (!parameters.ContainsKey(parentName)) { - items.Add(Utilities.ValueToString(item)); + parameters.Add(parentName, new List()); } + parameters[parentName].Add(""); } - - if (items.Count > 0) + else { - values.Add(string.Join(delimiter, items)); - } + foreach (var item in list) + { + if (explode) + { + values.Add(Utilities.ValueToString(item)); + } + else + { + items.Add(Utilities.ValueToString(item)); + } + } - foreach (var val in values) - { - if (!parameters.ContainsKey(parentName)) + if (items.Count > 0) { - parameters.Add(parentName, new List()); + values.Add(string.Join(delimiter, items)); } - parameters[parentName].Add(val); + foreach (var val in values) + { + if (!parameters.ContainsKey(parentName)) + { + parameters.Add(parentName, new List()); + } + + parameters[parentName].Add(val); + } } } else @@ -493,7 +522,16 @@ string delimiter parameters.Add(parentName, new List()); } - parameters[parentName].Add(Utilities.ValueToString(value)); + // Handle null values and empty strings for allowEmptyValue parameters + var stringValue = Utilities.ValueToString(value); + if ((value == null || stringValue == "") && allowEmptyValue?.Contains(parentName) == true) + { + parameters[parentName].Add(""); + } + else + { + parameters[parentName].Add(stringValue); + } } return parameters; diff --git a/sync-for-payables/Codat/Sync/Payables/Utils/Utilities.cs b/sync-for-payables/Codat/Sync/Payables/Utils/Utilities.cs index 799bc653b..f83b9d08b 100644 --- a/sync-for-payables/Codat/Sync/Payables/Utils/Utilities.cs +++ b/sync-for-payables/Codat/Sync/Payables/Utils/Utilities.cs @@ -303,6 +303,7 @@ public static string PrefixBearer(string authHeaderValue) return $"Bearer {authHeaderValue}"; } + public static string RemoveSuffix(string inputString, string suffix) { if (!String.IsNullOrEmpty(suffix) && inputString.EndsWith(suffix)) @@ -311,6 +312,7 @@ public static string RemoveSuffix(string inputString, string suffix) } return inputString; } + public static string TemplateUrl(string template, Dictionary paramDict) { foreach(KeyValuePair entry in paramDict) @@ -319,5 +321,19 @@ public static string TemplateUrl(string template, Dictionary par } return template; } + + public static Dictionary> CollectHeaders(HttpHeaders headers) + { + var dict = new Dictionary>(StringComparer.OrdinalIgnoreCase); + foreach (var header in headers) + { + if (!dict.ContainsKey(header.Key)) + { + dict[header.Key] = new List(); + } + dict[header.Key].AddRange(header.Value); + } + return dict; + } } } diff --git a/sync-for-payables/NUGET.md b/sync-for-payables/NUGET.md index 87fc3b551..d41b44b32 100644 --- a/sync-for-payables/NUGET.md +++ b/sync-for-payables/NUGET.md @@ -8,16 +8,15 @@ ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -34,16 +33,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync( @@ -57,7 +55,7 @@ var res = await sdk.Companies.ListAsync( ), retryConnectionErrors: false ), - req + request: req ); // handle response @@ -66,8 +64,8 @@ var res = await sdk.Companies.ListAsync( If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables( retryConfig: new RetryConfig( @@ -84,10 +82,9 @@ var sdk = new CodatSyncPayables( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -99,62 +96,86 @@ var res = await sdk.Companies.ListAsync(req); ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception. - -By default, an API error will raise a `Codat.Sync.Payables.Models.Errors.SDKException` exception, which has the following properties: +[`CodatSyncPayablesException`](./Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs) is the base exception class for all HTTP error responses. It has the following properties: | Property | Type | Description | |---------------|-----------------------|-----------------------| -| `Message` | *string* | The error message | -| `StatusCode` | *int* | The HTTP status code | -| `RawResponse` | *HttpResponseMessage* | The raw HTTP response | -| `Body` | *string* | The response content | - -When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `ListAsync` method throws the following exceptions: +| `Message` | *string* | Error message | +| `StatusCode` | *int* | HTTP status code | +| `Headers` | *HttpResponseHeaders* | HTTP headers | +| `ContentType` | *string?* | HTTP content type | +| `RawResponse` | *HttpResponseMessage* | HTTP response object | +| `Body` | *string* | HTTP response body | -| Error Type | Status Code | Content Type | -| ---------------------------------------------- | -------------------------------------- | ---------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | +Some exceptions in this SDK include an additional `Payload` field, which will contain deserialized custom error data when present. Possible exceptions are listed in the [Error Classes](#error-classes) section. ### Example ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; -using System; using Codat.Sync.Payables.Models.Errors; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); try { ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); // handle response } -catch (Exception ex) +catch (CodatSyncPayablesException ex) // all SDK exceptions inherit from CodatSyncPayablesException { - if (ex is ErrorMessage) + // ex.ToString() provides a detailed error message + System.Console.WriteLine(ex); + + // Base exception fields + HttpResponseMessage rawResponse = ex.RawResponse; + HttpResponseHeaders headers = ex.Headers; + int statusCode = ex.StatusCode; + string? contentType = ex.ContentType; + var responseBody = ex.Body; + + if (ex is ErrorMessage) // different exceptions may be thrown depending on the method { - // Handle exception data - throw; + // Check error data fields + ErrorMessagePayload payload = ex.Payload; + long StatusCode = payload.StatusCode; + string Service = payload.Service; + // ... } - else if (ex is Codat.Sync.Payables.Models.Errors.SDKException) + + // An underlying cause may be provided + if (ex.InnerException != null) { - // Handle default exception - throw; + Exception cause = ex.InnerException; } } +catch (System.Net.Http.HttpRequestException ex) +{ + // Check ex.InnerException for Network connectivity errors +} ``` + +### Error Classes + +**Primary exceptions:** +* [`CodatSyncPayablesException`](./Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs): The base class for HTTP error responses. + * [`ErrorMessage`](./Codat/Sync/Payables/Models/Errors/ErrorMessage.cs): Your `query` parameter was not correctly formed. + +**Less common exceptions (2)** + +* [`System.Net.Http.HttpRequestException`](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httprequestexception): Network connectivity error. For more details about the underlying cause, inspect the `ex.InnerException`. + +* Inheriting from [`CodatSyncPayablesException`](./Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs): + * [`ResponseValidationError`](./Codat/Sync/Payables/Models/Errors/ResponseValidationError.cs): Thrown when the response data could not be deserialized into the expected type. @@ -162,11 +183,11 @@ catch (Exception ex) ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: +The default server can be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables( serverUrl: "https://api.codat.io", @@ -174,10 +195,9 @@ var sdk = new CodatSyncPayables( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -200,16 +220,15 @@ This SDK supports the following security scheme globally: To authenticate with the API the `AuthHeader` parameter must be set when initializing the SDK client instance. For example: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -218,4 +237,146 @@ var res = await sdk.Companies.ListAsync(req); ``` + +## Custom HTTP Client + +The C# SDK makes API calls using an `ISpeakeasyHttpClient` that wraps the native +[HttpClient](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient). This +client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle +errors and response. + +The `ISpeakeasyHttpClient` interface allows you to either use the default `SpeakeasyHttpClient` that comes with the SDK, +or provide your own custom implementation with customized configuration such as custom message handlers, timeouts, +connection pooling, and other HTTP client settings. + +The following example shows how to create a custom HTTP client with request modification and error handling: + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Utils; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +// Create a custom HTTP client +public class CustomHttpClient : ISpeakeasyHttpClient +{ + private readonly ISpeakeasyHttpClient _defaultClient; + + public CustomHttpClient() + { + _defaultClient = new SpeakeasyHttpClient(); + } + + public async Task SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null) + { + // Add custom header and timeout + request.Headers.Add("x-custom-header", "custom value"); + request.Headers.Add("x-request-timeout", "30"); + + try + { + var response = await _defaultClient.SendAsync(request, cancellationToken); + // Log successful response + Console.WriteLine($"Request successful: {response.StatusCode}"); + return response; + } + catch (Exception error) + { + // Log error + Console.WriteLine($"Request failed: {error.Message}"); + throw; + } + } + + public void Dispose() + { + _httpClient?.Dispose(); + _defaultClient?.Dispose(); + } +} + +// Use the custom HTTP client with the SDK +var customHttpClient = new CustomHttpClient(); +var sdk = new CodatSyncPayables(client: customHttpClient); +``` + +**You can also provide a completely custom HTTP client with your own configuration:** + +```csharp +using Codat.Sync.Payables.Utils; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +// Custom HTTP client with custom configuration +public class AdvancedHttpClient : ISpeakeasyHttpClient +{ + private readonly HttpClient _httpClient; + + public AdvancedHttpClient() + { + var handler = new HttpClientHandler() + { + MaxConnectionsPerServer = 10, + // ServerCertificateCustomValidationCallback = customCertValidation, // Custom SSL validation if needed + }; + + _httpClient = new HttpClient(handler) + { + Timeout = TimeSpan.FromSeconds(30) + }; + } + + public async Task SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null) + { + return await _httpClient.SendAsync(request, cancellationToken ?? CancellationToken.None); + } + + public void Dispose() + { + _httpClient?.Dispose(); + } +} + +var sdk = CodatSyncPayables.Builder() + .WithClient(new AdvancedHttpClient()) + .Build(); +``` + +**For simple debugging, you can enable request/response logging by implementing a custom client:** + +```csharp +public class LoggingHttpClient : ISpeakeasyHttpClient +{ + private readonly ISpeakeasyHttpClient _innerClient; + + public LoggingHttpClient(ISpeakeasyHttpClient innerClient = null) + { + _innerClient = innerClient ?? new SpeakeasyHttpClient(); + } + + public async Task SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null) + { + // Log request + Console.WriteLine($"Sending {request.Method} request to {request.RequestUri}"); + + var response = await _innerClient.SendAsync(request, cancellationToken); + + // Log response + Console.WriteLine($"Received {response.StatusCode} response"); + + return response; + } + + public void Dispose() => _innerClient?.Dispose(); +} + +var sdk = new CodatSyncPayables(client: new LoggingHttpClient()); +``` + +The SDK also provides built-in hook support through the `SDKConfiguration.Hooks` system, which automatically handles +`BeforeRequestAsync`, `AfterSuccessAsync`, and `AfterErrorAsync` hooks for advanced request lifecycle management. + + \ No newline at end of file diff --git a/sync-for-payables/README.md b/sync-for-payables/README.md index 3f96ff58e..959200166 100644 --- a/sync-for-payables/README.md +++ b/sync-for-payables/README.md @@ -7,11 +7,11 @@ Streamline your customers' accounts payable workflow. ## Summary -Bill pay kit: The API reference for the Bill Pay kit. +Bill pay (synchronous solution): The API reference for the synchronous Bill Pay solution. -The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. +The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. -[Explore product](https://docs.codat.io/payables/bill-pay-kit) | [See OpenAPI spec](https://github.com/codatio/oas) +[Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- ## Supported Integrations @@ -21,7 +21,9 @@ The bill pay kit is an API and a set of supporting tools designed to integrate a | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | +| Sage Intacct | Yes | | Xero | Yes | +| Zoho Books | Yes | --- @@ -41,14 +43,20 @@ The bill pay kit is an API and a set of supporting tools designed to integrate a ## Table of Contents + +* [Sync for Payables](#sync-for-payables) + * [Supported Integrations](#supported-integrations) + * [Endpoints](#endpoints) + * [SDK Installation](#sdk-installation) + * [Example Usage](#example-usage) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Retries](#retries) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Authentication](#authentication) + * [Custom HTTP Client](#custom-http-client) -* [SDK Installation](#sdk-installation) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [Retries](#retries) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) -* [Authentication](#authentication) @@ -77,16 +85,15 @@ dotnet add reference Codat/Sync/Payables/Codat.Sync.Payables.csproj ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -115,15 +122,16 @@ var res = await sdk.Companies.ListAsync(req); * [GetBillOptions](docs/sdks/bills/README.md#getbilloptions) - Get bill mapping options * [List](docs/sdks/bills/README.md#list) - List bills * [Create](docs/sdks/bills/README.md#create) - Create bill +* [Update](docs/sdks/bills/README.md#update) - Update bill * [UploadAttachment](docs/sdks/bills/README.md#uploadattachment) - Upload bill attachment * [ListAttachments](docs/sdks/bills/README.md#listattachments) - List bill attachments * [DownloadAttachment](docs/sdks/bills/README.md#downloadattachment) - Download bill attachment - ### [Companies](docs/sdks/companies/README.md) * [List](docs/sdks/companies/README.md#list) - List companies * [Create](docs/sdks/companies/README.md#create) - Create company +* [Replace](docs/sdks/companies/README.md#replace) - Replace company * [Update](docs/sdks/companies/README.md#update) - Update company * [Delete](docs/sdks/companies/README.md#delete) - Delete a company * [Get](docs/sdks/companies/README.md#get) - Get company @@ -156,16 +164,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync( @@ -179,7 +186,7 @@ var res = await sdk.Companies.ListAsync( ), retryConnectionErrors: false ), - req + request: req ); // handle response @@ -188,8 +195,8 @@ var res = await sdk.Companies.ListAsync( If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables( retryConfig: new RetryConfig( @@ -206,10 +213,9 @@ var sdk = new CodatSyncPayables( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -221,62 +227,87 @@ var res = await sdk.Companies.ListAsync(req); ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception. - -By default, an API error will raise a `Codat.Sync.Payables.Models.Errors.SDKException` exception, which has the following properties: +[`CodatSyncPayablesException`](./Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs) is the base exception class for all HTTP error responses. It has the following properties: | Property | Type | Description | |---------------|-----------------------|-----------------------| -| `Message` | *string* | The error message | -| `StatusCode` | *int* | The HTTP status code | -| `RawResponse` | *HttpResponseMessage* | The raw HTTP response | -| `Body` | *string* | The response content | - -When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `ListAsync` method throws the following exceptions: +| `Message` | *string* | Error message | +| `StatusCode` | *int* | HTTP status code | +| `Headers` | *HttpResponseHeaders* | HTTP headers | +| `ContentType` | *string?* | HTTP content type | +| `RawResponse` | *HttpResponseMessage* | HTTP response object | +| `Body` | *string* | HTTP response body | -| Error Type | Status Code | Content Type | -| ---------------------------------------------- | -------------------------------------- | ---------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | +Some exceptions in this SDK include an additional `Payload` field, which will contain deserialized custom error data when present. Possible exceptions are listed in the [Error Classes](#error-classes) section. ### Example ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; -using System; using Codat.Sync.Payables.Models.Errors; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); try { ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); // handle response } -catch (Exception ex) +catch (CodatSyncPayablesException ex) // all SDK exceptions inherit from CodatSyncPayablesException { - if (ex is ErrorMessage) + // ex.ToString() provides a detailed error message + System.Console.WriteLine(ex); + + // Base exception fields + HttpResponseMessage rawResponse = ex.RawResponse; + HttpResponseHeaders headers = ex.Headers; + int statusCode = ex.StatusCode; + string? contentType = ex.ContentType; + var responseBody = ex.Body; + + if (ex is ErrorMessage) // different exceptions may be thrown depending on the method { - // Handle exception data - throw; + // Check error data fields + ErrorMessagePayload payload = ex.Payload; + long StatusCode = payload.StatusCode; + string Service = payload.Service; + // ... } - else if (ex is Codat.Sync.Payables.Models.Errors.SDKException) + + // An underlying cause may be provided + if (ex.InnerException != null) { - // Handle default exception - throw; + Exception cause = ex.InnerException; } } +catch (System.Net.Http.HttpRequestException ex) +{ + // Check ex.InnerException for Network connectivity errors +} ``` + +### Error Classes + +**Primary exceptions:** +* [`CodatSyncPayablesException`](./Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs): The base class for HTTP error responses. + * [`ErrorMessage`](./Codat/Sync/Payables/Models/Errors/ErrorMessage.cs): Your `query` parameter was not correctly formed. + +
Less common exceptions (2) + +* [`System.Net.Http.HttpRequestException`](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httprequestexception): Network connectivity error. For more details about the underlying cause, inspect the `ex.InnerException`. + +* Inheriting from [`CodatSyncPayablesException`](./Codat/Sync/Payables/Models/Errors/CodatSyncPayablesException.cs): + * [`ResponseValidationError`](./Codat/Sync/Payables/Models/Errors/ResponseValidationError.cs): Thrown when the response data could not be deserialized into the expected type. +
@@ -284,11 +315,11 @@ catch (Exception ex) ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: +The default server can be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables( serverUrl: "https://api.codat.io", @@ -296,10 +327,9 @@ var sdk = new CodatSyncPayables( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -322,16 +352,15 @@ This SDK supports the following security scheme globally: To authenticate with the API the `AuthHeader` parameter must be set when initializing the SDK client instance. For example: ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -340,6 +369,152 @@ var res = await sdk.Companies.ListAsync(req); ``` + +## Custom HTTP Client + +The C# SDK makes API calls using an `ISpeakeasyHttpClient` that wraps the native +[HttpClient](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient). This +client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle +errors and response. + +The `ISpeakeasyHttpClient` interface allows you to either use the default `SpeakeasyHttpClient` that comes with the SDK, +or provide your own custom implementation with customized configuration such as custom message handlers, timeouts, +connection pooling, and other HTTP client settings. + +The following example shows how to create a custom HTTP client with request modification and error handling: + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Utils; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +// Create a custom HTTP client +public class CustomHttpClient : ISpeakeasyHttpClient +{ + private readonly ISpeakeasyHttpClient _defaultClient; + + public CustomHttpClient() + { + _defaultClient = new SpeakeasyHttpClient(); + } + + public async Task SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null) + { + // Add custom header and timeout + request.Headers.Add("x-custom-header", "custom value"); + request.Headers.Add("x-request-timeout", "30"); + + try + { + var response = await _defaultClient.SendAsync(request, cancellationToken); + // Log successful response + Console.WriteLine($"Request successful: {response.StatusCode}"); + return response; + } + catch (Exception error) + { + // Log error + Console.WriteLine($"Request failed: {error.Message}"); + throw; + } + } + + public void Dispose() + { + _httpClient?.Dispose(); + _defaultClient?.Dispose(); + } +} + +// Use the custom HTTP client with the SDK +var customHttpClient = new CustomHttpClient(); +var sdk = new CodatSyncPayables(client: customHttpClient); +``` + +
+You can also provide a completely custom HTTP client with your own configuration: + +```csharp +using Codat.Sync.Payables.Utils; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +// Custom HTTP client with custom configuration +public class AdvancedHttpClient : ISpeakeasyHttpClient +{ + private readonly HttpClient _httpClient; + + public AdvancedHttpClient() + { + var handler = new HttpClientHandler() + { + MaxConnectionsPerServer = 10, + // ServerCertificateCustomValidationCallback = customCertValidation, // Custom SSL validation if needed + }; + + _httpClient = new HttpClient(handler) + { + Timeout = TimeSpan.FromSeconds(30) + }; + } + + public async Task SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null) + { + return await _httpClient.SendAsync(request, cancellationToken ?? CancellationToken.None); + } + + public void Dispose() + { + _httpClient?.Dispose(); + } +} + +var sdk = CodatSyncPayables.Builder() + .WithClient(new AdvancedHttpClient()) + .Build(); +``` +
+ +
+For simple debugging, you can enable request/response logging by implementing a custom client: + +```csharp +public class LoggingHttpClient : ISpeakeasyHttpClient +{ + private readonly ISpeakeasyHttpClient _innerClient; + + public LoggingHttpClient(ISpeakeasyHttpClient innerClient = null) + { + _innerClient = innerClient ?? new SpeakeasyHttpClient(); + } + + public async Task SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null) + { + // Log request + Console.WriteLine($"Sending {request.Method} request to {request.RequestUri}"); + + var response = await _innerClient.SendAsync(request, cancellationToken); + + // Log response + Console.WriteLine($"Received {response.StatusCode} response"); + + return response; + } + + public void Dispose() => _innerClient?.Dispose(); +} + +var sdk = new CodatSyncPayables(client: new LoggingHttpClient()); +``` +
+ +The SDK also provides built-in hook support through the `SDKConfiguration.Hooks` system, which automatically handles +`BeforeRequestAsync`, `AfterSuccessAsync`, and `AfterErrorAsync` hooks for advanced request lifecycle management. + + diff --git a/sync-for-payables/RELEASES.md b/sync-for-payables/RELEASES.md index 2ade77120..7a8669922 100644 --- a/sync-for-payables/RELEASES.md +++ b/sync-for-payables/RELEASES.md @@ -178,4 +178,14 @@ Based on: ### Generated - [csharp v10.0.0] sync-for-payables ### Releases -- [NuGet v10.0.0] https://www.nuget.org/packages/Codat.Sync.Payables/10.0.0 - sync-for-payables \ No newline at end of file +- [NuGet v10.0.0] https://www.nuget.org/packages/Codat.Sync.Payables/10.0.0 - sync-for-payables + +## 2026-02-09 13:57:50 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.709.1 (2.812.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v10.1.0] sync-for-payables +### Releases +- [NuGet v10.1.0] https://www.nuget.org/packages/Codat.Sync.Payables/10.1.0 - sync-for-payables \ No newline at end of file diff --git a/sync-for-payables/USAGE.md b/sync-for-payables/USAGE.md index 71a90519c..6e49064f2 100644 --- a/sync-for-payables/USAGE.md +++ b/sync-for-payables/USAGE.md @@ -1,16 +1,15 @@ ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); diff --git a/sync-for-payables/docs/Models/Components/AccountMappingOption.md b/sync-for-payables/docs/Models/Components/AccountMappingOption.md index 49d819fb4..24fae6614 100644 --- a/sync-for-payables/docs/Models/Components/AccountMappingOption.md +++ b/sync-for-payables/docs/Models/Components/AccountMappingOption.md @@ -9,6 +9,6 @@ | `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. | GBP | +| `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` | [AccountStatus](../../Models/Components/AccountStatus.md) | :heavy_minus_sign: | The current status of the account. | Active | -| `SourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/Attachment.md b/sync-for-payables/docs/Models/Components/Attachment.md index 52d80151e..5661cc913 100644 --- a/sync-for-payables/docs/Models/Components/Attachment.md +++ b/sync-for-payables/docs/Models/Components/Attachment.md @@ -25,7 +25,7 @@ | `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. | 2022-10-23 00:00:00 +0000 UTC | +| `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` | *int* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | | `IncludeWhenSent` | *bool* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | -| `SourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/BankAccount.md b/sync-for-payables/docs/Models/Components/BankAccount.md index 9f4a82cc5..5d162a4f6 100644 --- a/sync-for-payables/docs/Models/Components/BankAccount.md +++ b/sync-for-payables/docs/Models/Components/BankAccount.md @@ -11,6 +11,6 @@ | `AccountType` | [BankAccountType](../../Models/Components/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. | GBP | +| `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` | [BankAccountStatus](../../Models/Components/BankAccountStatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | -| `SourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/BankAccountMappingOption.md b/sync-for-payables/docs/Models/Components/BankAccountMappingOption.md index 4b0c81eee..c11ec369c 100644 --- a/sync-for-payables/docs/Models/Components/BankAccountMappingOption.md +++ b/sync-for-payables/docs/Models/Components/BankAccountMappingOption.md @@ -13,4 +13,4 @@ | `Currency` | *string* | :heavy_minus_sign: | The bank account's base currency. | | | `Status` | [BankAccountStatus](../../Models/Components/BankAccountStatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | | `AccountType` | [BankAccountType](../../Models/Components/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 | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/BankAccountPrototype.md b/sync-for-payables/docs/Models/Components/BankAccountPrototype.md index 106a1141d..7a7adef9c 100644 --- a/sync-for-payables/docs/Models/Components/BankAccountPrototype.md +++ b/sync-for-payables/docs/Models/Components/BankAccountPrototype.md @@ -10,4 +10,4 @@ | `AccountType` | [BankAccountType](../../Models/Components/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. | GBP | \ No newline at end of file +| `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/Models/Components/Bill.md b/sync-for-payables/docs/Models/Components/Bill.md index 9356fdcdf..1626ea1dc 100644 --- a/sync-for-payables/docs/Models/Components/Bill.md +++ b/sync-for-payables/docs/Models/Components/Bill.md @@ -10,12 +10,12 @@ | `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` | [SupplierRef](../../Models/Components/SupplierRef.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `IssueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `DueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `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. | GBP | +| `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` | List<[BillLineItem](../../Models/Components/BillLineItem.md)> | :heavy_minus_sign: | Array of Bill line items. | | | `Status` | [BillStatus](../../Models/Components/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. | | -| `SourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/BillLineItem.md b/sync-for-payables/docs/Models/Components/BillLineItem.md index 32aaf559c..e8d3415e3 100644 --- a/sync-for-payables/docs/Models/Components/BillLineItem.md +++ b/sync-for-payables/docs/Models/Components/BillLineItem.md @@ -6,9 +6,10 @@ | Field | Type | Required | Description | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | | `Description` | *string* | :heavy_minus_sign: | Friendly name of the goods or services received. | -| `UnitAmount` | *decimal* | :heavy_check_mark: | Unit price of the goods or service. | -| `Quantity` | *decimal* | :heavy_check_mark: | Number of units of 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` | [BillAccountRef](../../Models/Components/BillAccountRef.md) | :heavy_check_mark: | Reference to the account to which the line item is linked. | +| `AccountRef` | [BillAccountRef](../../Models/Components/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` | [BillTaxRateRef](../../Models/Components/BillTaxRateRef.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | \ No newline at end of file +| `TaxRateRef` | [BillTaxRateRef](../../Models/Components/BillTaxRateRef.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | +| `TrackingRefs` | List<[TrackingRef](../../Models/Components/TrackingRef.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/BillPayment.md b/sync-for-payables/docs/Models/Components/BillPayment.md index 8832ce80a..5f70c4023 100644 --- a/sync-for-payables/docs/Models/Components/BillPayment.md +++ b/sync-for-payables/docs/Models/Components/BillPayment.md @@ -7,7 +7,7 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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 | 2022-10-23 00:00:00 +0000 UTC | +| `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` | [BillPaymentAccountRef](../../Models/Components/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 diff --git a/sync-for-payables/docs/Models/Components/BillPaymentPrototype.md b/sync-for-payables/docs/Models/Components/BillPaymentPrototype.md index be9f20acc..f1153d59f 100644 --- a/sync-for-payables/docs/Models/Components/BillPaymentPrototype.md +++ b/sync-for-payables/docs/Models/Components/BillPaymentPrototype.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Amount` | *decimal* | :heavy_check_mark: | Amount of the payment in the bill currency. | 1329.54 | -| `Date` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `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` | [BillPaymentAccountRef](../../Models/Components/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 diff --git a/sync-for-payables/docs/Models/Components/BillPrototype.md b/sync-for-payables/docs/Models/Components/BillPrototype.md index d93182bb8..6700edd61 100644 --- a/sync-for-payables/docs/Models/Components/BillPrototype.md +++ b/sync-for-payables/docs/Models/Components/BillPrototype.md @@ -7,9 +7,9 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | | `SupplierRef` | [SupplierRef](../../Models/Components/SupplierRef.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `IssueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `DueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `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. | GBP | +| `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` | List<[BillLineItem](../../Models/Components/BillLineItem.md)> | :heavy_minus_sign: | Array of Bill line items. | | | `Status` | [BillStatus](../../Models/Components/BillStatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhook.md b/sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhook.md deleted file mode 100644 index f9688f30c..000000000 --- a/sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhook.md +++ /dev/null @@ -1,16 +0,0 @@ -# ClientRateLimitReachedWebhook - -Webhook request body for a client that has reached their rate limit. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | -| `Data` | [ClientRateLimitReachedWebhookData](../../Models/Components/ClientRateLimitReachedWebhookData.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhookData.md b/sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhookData.md deleted file mode 100644 index 64767445b..000000000 --- a/sync-for-payables/docs/Models/Components/ClientRateLimitReachedWebhookData.md +++ /dev/null @@ -1,9 +0,0 @@ -# ClientRateLimitReachedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DailyQuota` | *long* | :heavy_minus_sign: | The number of available requests per day. | | -| `ExpiresUtc` | *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. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhook.md b/sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhook.md deleted file mode 100644 index d78d8b131..000000000 --- a/sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhook.md +++ /dev/null @@ -1,16 +0,0 @@ -# ClientRateLimitResetWebhook - -Webhook request body for a client that has had their rate limit reset. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | -| `Data` | [ClientRateLimitResetWebhookData](../../Models/Components/ClientRateLimitResetWebhookData.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/ClientRateLimitWebhook.md b/sync-for-payables/docs/Models/Components/ClientRateLimitWebhook.md index 6a373aea1..b5ded115e 100644 --- a/sync-for-payables/docs/Models/Components/ClientRateLimitWebhook.md +++ b/sync-for-payables/docs/Models/Components/ClientRateLimitWebhook.md @@ -6,6 +6,6 @@ | 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. | client.rateLimit.reset | -| `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. | 2022-10-23 00:00:00 +0000 UTC | +| `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` | [ClientRateLimitWebhookPayload](../../Models/Components/ClientRateLimitWebhookPayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/ClientRateLimitWebhookPayload.md b/sync-for-payables/docs/Models/Components/ClientRateLimitWebhookPayload.md index d055dc184..ba8538894 100644 --- a/sync-for-payables/docs/Models/Components/ClientRateLimitWebhookPayload.md +++ b/sync-for-payables/docs/Models/Components/ClientRateLimitWebhookPayload.md @@ -7,4 +7,4 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `DailyQuota` | *long* | :heavy_minus_sign: | The number of available requests per day. | | | `QuotaRemaining` | *long* | :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. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/Company.md b/sync-for-payables/docs/Models/Components/Company.md index 9f2cfd2a0..038238510 100644 --- a/sync-for-payables/docs/Models/Components/Company.md +++ b/sync-for-payables/docs/Models/Components/Company.md @@ -15,8 +15,8 @@ When you create a company, you can specify a `name` and we will automatically ge | `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. | 2022-10-23 00:00:00 +0000 UTC | -| `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. | 2022-10-23 00:00:00 +0000 UTC | +| `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` | List<*string*> | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | | `Tags` | Dictionary | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | diff --git a/sync-for-payables/docs/Models/Components/CompanyUpdateRequest.md b/sync-for-payables/docs/Models/Components/CompanyUpdateRequest.md new file mode 100644 index 000000000..2e5fa23d7 --- /dev/null +++ b/sync-for-payables/docs/Models/Components/CompanyUpdateRequest.md @@ -0,0 +1,10 @@ +# CompanyUpdateRequest + + +## 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` | Dictionary | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/Connection.md b/sync-for-payables/docs/Models/Components/Connection.md index 92ecdfc4b..c62e97464 100644 --- a/sync-for-payables/docs/Models/Components/Connection.md +++ b/sync-for-payables/docs/Models/Components/Connection.md @@ -24,7 +24,7 @@ Before you can use a data connection to pull or push data, the company must gran | `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` | [DataConnectionStatus](../../Models/Components/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. | 2022-10-23 00:00:00 +0000 UTC | -| `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. | 2022-10-23 00:00:00 +0000 UTC | +| `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` | List<[DataConnectionError](../../Models/Components/DataConnectionError.md)> | :heavy_minus_sign: | N/A | | -| `ConnectionInfo` | Dictionary | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `ConnectionInfo` | Dictionary | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/DataConnectionError.md b/sync-for-payables/docs/Models/Components/DataConnectionError.md index 48e3b7bbb..2e7779da3 100644 --- a/sync-for-payables/docs/Models/Components/DataConnectionError.md +++ b/sync-for-payables/docs/Models/Components/DataConnectionError.md @@ -8,6 +8,6 @@ | `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. | 2022-10-23 00:00:00 +0000 UTC | +| `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` | [ErrorStatus](../../Models/Components/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. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `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/Models/Components/DataType.md b/sync-for-payables/docs/Models/Components/DataType.md new file mode 100644 index 000000000..f20ceb8d2 --- /dev/null +++ b/sync-for-payables/docs/Models/Components/DataType.md @@ -0,0 +1,11 @@ +# DataType + +The type of the linked reference. + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `TrackingCategories` | trackingCategories | +| `Customers` | customers | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/Supplier.md b/sync-for-payables/docs/Models/Components/Supplier.md index aa5046a23..3de574b77 100644 --- a/sync-for-payables/docs/Models/Components/Supplier.md +++ b/sync-for-payables/docs/Models/Components/Supplier.md @@ -8,15 +8,15 @@ Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Id` | *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. | +44 25691 154789 | -| `Addresses` | List<[Address](../../Models/Components/Address.md)> | :heavy_minus_sign: | An array of Addresses. | | -| `Status` | [SupplierStatus](../../Models/Components/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. | | -| `SourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Id` | *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` | List<[Address](../../Models/Components/Address.md)> | :heavy_minus_sign: | An array of Addresses. | | +| `Status` | [SupplierStatus](../../Models/Components/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. | | +| `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/Models/Components/SupplierPrototype.md b/sync-for-payables/docs/Models/Components/SupplierPrototype.md index 468f45642..4e84d45db 100644 --- a/sync-for-payables/docs/Models/Components/SupplierPrototype.md +++ b/sync-for-payables/docs/Models/Components/SupplierPrototype.md @@ -3,13 +3,13 @@ ## 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. | +44 25691 154789 | -| `Addresses` | List<[Address](../../Models/Components/Address.md)> | :heavy_minus_sign: | An array of Addresses. | | -| `Status` | [SupplierStatus](../../Models/Components/SupplierStatus.md) | :heavy_check_mark: | 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. | | \ No newline at end of file +| 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` | List<[Address](../../Models/Components/Address.md)> | :heavy_minus_sign: | An array of Addresses. | | +| `Status` | [SupplierStatus](../../Models/Components/SupplierStatus.md) | :heavy_check_mark: | 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. | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/TrackingRef.md b/sync-for-payables/docs/Models/Components/TrackingRef.md new file mode 100644 index 000000000..35573aec4 --- /dev/null +++ b/sync-for-payables/docs/Models/Components/TrackingRef.md @@ -0,0 +1,10 @@ +# TrackingRef + + +## 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` | [DataType](../../Models/Components/DataType.md) | :heavy_minus_sign: | The type of the linked reference. | trackingCategories | +| `IsBillable` | *bool* | :heavy_minus_sign: | If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/CreateBillPaymentRequest.md b/sync-for-payables/docs/Models/Requests/CreateBillPaymentRequest.md index 35ac7fb4d..d476ddc01 100644 --- a/sync-for-payables/docs/Models/Requests/CreateBillPaymentRequest.md +++ b/sync-for-payables/docs/Models/Requests/CreateBillPaymentRequest.md @@ -3,10 +3,10 @@ ## 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. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `IdempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | -| `BillPaymentPrototype` | [BillPaymentPrototype](../../Models/Components/BillPaymentPrototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| 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. | | +| `BillPaymentPrototype` | [BillPaymentPrototype](../../Models/Components/BillPaymentPrototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/CreateCompanyResponse.md b/sync-for-payables/docs/Models/Requests/CreateCompanyResponse.md index def78685c..ebbbbda7f 100644 --- a/sync-for-payables/docs/Models/Requests/CreateCompanyResponse.md +++ b/sync-for-payables/docs/Models/Requests/CreateCompanyResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/DownloadBillAttachmentRequest.md b/sync-for-payables/docs/Models/Requests/DownloadBillAttachmentRequest.md index 5eec6203f..9c09dd038 100644 --- a/sync-for-payables/docs/Models/Requests/DownloadBillAttachmentRequest.md +++ b/sync-for-payables/docs/Models/Requests/DownloadBillAttachmentRequest.md @@ -3,9 +3,9 @@ ## 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. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `AttachmentId` | *string* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file +| 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/Models/Requests/GetCompanyResponse.md b/sync-for-payables/docs/Models/Requests/GetCompanyResponse.md index 2151d7b95..816d16523 100644 --- a/sync-for-payables/docs/Models/Requests/GetCompanyResponse.md +++ b/sync-for-payables/docs/Models/Requests/GetCompanyResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/ListBillAttachmentsRequest.md b/sync-for-payables/docs/Models/Requests/ListBillAttachmentsRequest.md index 05c8798e9..045f9cd5f 100644 --- a/sync-for-payables/docs/Models/Requests/ListBillAttachmentsRequest.md +++ b/sync-for-payables/docs/Models/Requests/ListBillAttachmentsRequest.md @@ -3,8 +3,8 @@ ## 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. | 13d946f0-c5d5-42bc-b092-97ece17923ab | \ No newline at end of file +| 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/Models/Requests/ListCompaniesRequest.md b/sync-for-payables/docs/Models/Requests/ListCompaniesRequest.md index edfdc6b36..350f218c0 100644 --- a/sync-for-payables/docs/Models/Requests/ListCompaniesRequest.md +++ b/sync-for-payables/docs/Models/Requests/ListCompaniesRequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `PageSize` | *int* | :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 +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `PageSize` | *int* | :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/Models/Requests/ReplaceCompanyRequest.md b/sync-for-payables/docs/Models/Requests/ReplaceCompanyRequest.md new file mode 100644 index 000000000..b3b949cbb --- /dev/null +++ b/sync-for-payables/docs/Models/Requests/ReplaceCompanyRequest.md @@ -0,0 +1,9 @@ +# ReplaceCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `CompanyRequestBody` | [CompanyRequestBody](../../Models/Components/CompanyRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhookData.md b/sync-for-payables/docs/Models/Requests/ReplaceCompanyResponse.md similarity index 79% rename from sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhookData.md rename to sync-for-payables/docs/Models/Requests/ReplaceCompanyResponse.md index b6cadb02d..46ff9ecba 100644 --- a/sync-for-payables/docs/Models/Components/ClientRateLimitResetWebhookData.md +++ b/sync-for-payables/docs/Models/Requests/ReplaceCompanyResponse.md @@ -1,11 +1,11 @@ -# ClientRateLimitResetWebhookData +# ReplaceCompanyResponse ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `QuotaRemaining` | *long* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `ResetReason` | *string* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | -| `DailyQuota` | *long* | :heavy_minus_sign: | The number of available requests per day. | | -| `ExpiresUtc` | *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. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/UpdateBillRequest.md b/sync-for-payables/docs/Models/Requests/UpdateBillRequest.md new file mode 100644 index 000000000..a156987fc --- /dev/null +++ b/sync-for-payables/docs/Models/Requests/UpdateBillRequest.md @@ -0,0 +1,12 @@ +# UpdateBillRequest + + +## 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. | | +| `BillPrototype` | [BillPrototype](../../Models/Components/BillPrototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Webhooks/ClientRateLimitReachedResponse1.md b/sync-for-payables/docs/Models/Requests/UpdateBillResponse.md similarity index 82% rename from sync-for-payables/docs/Models/Webhooks/ClientRateLimitReachedResponse1.md rename to sync-for-payables/docs/Models/Requests/UpdateBillResponse.md index be0a6f609..7947d55c3 100644 --- a/sync-for-payables/docs/Models/Webhooks/ClientRateLimitReachedResponse1.md +++ b/sync-for-payables/docs/Models/Requests/UpdateBillResponse.md @@ -1,4 +1,4 @@ -# ClientRateLimitReachedResponse1 +# UpdateBillResponse ## Fields @@ -7,4 +7,5 @@ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Bill` | [Bill](../../Models/Components/Bill.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/UpdateCompanyRequest.md b/sync-for-payables/docs/Models/Requests/UpdateCompanyRequest.md index 70ad89eee..2351dd6e6 100644 --- a/sync-for-payables/docs/Models/Requests/UpdateCompanyRequest.md +++ b/sync-for-payables/docs/Models/Requests/UpdateCompanyRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `CompanyRequestBody` | [CompanyRequestBody](../../Models/Components/CompanyRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `CompanyUpdateRequest` | [CompanyUpdateRequest](../../Models/Components/CompanyUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/UpdateCompanyResponse.md b/sync-for-payables/docs/Models/Requests/UpdateCompanyResponse.md index 1605884f0..7df91368d 100644 --- a/sync-for-payables/docs/Models/Requests/UpdateCompanyResponse.md +++ b/sync-for-payables/docs/Models/Requests/UpdateCompanyResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"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",
"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",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Requests/UploadBillAttachmentRequest.md b/sync-for-payables/docs/Models/Requests/UploadBillAttachmentRequest.md index c69bddd81..36ee5d189 100644 --- a/sync-for-payables/docs/Models/Requests/UploadBillAttachmentRequest.md +++ b/sync-for-payables/docs/Models/Requests/UploadBillAttachmentRequest.md @@ -3,9 +3,9 @@ ## 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. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `AttachmentUpload` | [AttachmentUpload](../../Models/Components/AttachmentUpload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| 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` | [AttachmentUpload](../../Models/Components/AttachmentUpload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/Models/Webhooks/ClientRateLimitResetResponse1.md b/sync-for-payables/docs/Models/Webhooks/ClientRateLimitResetResponse1.md deleted file mode 100644 index 5a6778e68..000000000 --- a/sync-for-payables/docs/Models/Webhooks/ClientRateLimitResetResponse1.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitResetResponse1 - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ 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 3bd1537e2..74936b225 100644 --- a/sync-for-payables/docs/sdks/bankaccounts/README.md +++ b/sync-for-payables/docs/sdks/bankaccounts/README.md @@ -1,5 +1,4 @@ # BankAccounts -(*BankAccounts*) ## Overview @@ -11,16 +10,44 @@ Create a bank account for a given company's connection. ## Create -The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. - +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. + [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. -### Example Usage +### Example Usage: Bank account example + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateBankAccountRequest req = new CreateBankAccountRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BankAccountPrototype = new BankAccountPrototype() { + NominalCode = "22", + Name = "Plutus - Payables - Bank Account 12", + AccountType = BankAccountType.Debit, + AccountNumber = "0120 0440", + SortCode = "50-50-50", + Currency = "GBP", + }, +}; + +var res = await sdk.BankAccounts.CreateAsync(req); + +// handle response +``` +### Example Usage: Malformed query + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -29,9 +56,9 @@ CreateBankAccountRequest req = new CreateBankAccountRequest() { ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", BankAccountPrototype = new BankAccountPrototype() { Name = "", - AccountType = Codat.Sync.Payables.Models.Components.BankAccountType.Credit, + AccountType = BankAccountType.Debit, AccountNumber = "", - Currency = "USD", + Currency = "GBP", }, }; @@ -54,5 +81,6 @@ var res = await sdk.BankAccounts.CreateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 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 ce34ce122..78b4049c0 100644 --- a/sync-for-payables/docs/sdks/billpayments/README.md +++ b/sync-for-payables/docs/sdks/billpayments/README.md @@ -1,5 +1,4 @@ # BillPayments -(*BillPayments*) ## Overview @@ -12,18 +11,19 @@ Get, create, and update Bill payments. ## 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. - +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 + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -53,7 +53,8 @@ var res = await sdk.BillPayments.GetPaymentOptionsAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create @@ -62,19 +63,77 @@ The *Create bill payment* endpoint creates a new [bill payment](https://docs.cod [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. -### Example Usage +### Example Usage: Bill payment + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateBillPaymentRequest req = new CreateBillPaymentRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", + BillPaymentPrototype = new BillPaymentPrototype() { + Amount = 1329.54M, + Date = "2022-10-23T00:00:00Z", + Reference = "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + AccountRef = new BillPaymentAccountRef() { + Id = "", + }, + }, +}; + +var res = await sdk.BillPayments.CreateAsync(req); + +// handle response +``` +### Example Usage: Bill payment example + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateBillPaymentRequest req = new CreateBillPaymentRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", + BillPaymentPrototype = new BillPaymentPrototype() { + Amount = 22M, + Date = "2022-10-23T00:00:00.000Z", + Reference = "Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44", + AccountRef = new BillPaymentAccountRef() { + Id = "7bda9f44sr56", + }, + CurrencyRate = 1M, + }, +}; + +var res = await sdk.BillPayments.CreateAsync(req); + +// handle response +``` +### Example Usage: Malformed query + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); CreateBillPaymentRequest req = new CreateBillPaymentRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", - BillId = "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", BillPaymentPrototype = new BillPaymentPrototype() { Amount = 1329.54M, Date = "2022-10-23T00:00:00Z", @@ -104,5 +163,6 @@ var res = await sdk.BillPayments.CreateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 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 1e16f532e..3d4d3ac8c 100644 --- a/sync-for-payables/docs/sdks/bills/README.md +++ b/sync-for-payables/docs/sdks/bills/README.md @@ -1,5 +1,4 @@ # Bills -(*Bills*) ## Overview @@ -10,6 +9,7 @@ Get, create, and update Bills. * [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 @@ -24,10 +24,11 @@ Mapping options are a set of accounts and tax rates used to configure the SMB's ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -57,7 +58,8 @@ var res = await sdk.Bills.GetBillOptionsAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## List @@ -68,12 +70,117 @@ The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-f By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. -### Example Usage +### Example Usage: Bills + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListBillsRequest req = new ListBillsRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", +}; + +var res = await sdk.Bills.ListAsync(req); + +// handle response +``` +### Example Usage: Source modified date + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListBillsRequest req = new ListBillsRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + Query = "sourceModifiedDate>2023-12-15T00:00:00.000Z", +}; + +var res = await sdk.Bills.ListAsync(req); + +// handle response +``` +### Example Usage: Status (open) + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListBillsRequest req = new ListBillsRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + Query = "status=Open", +}; + +var res = await sdk.Bills.ListAsync(req); + +// handle response +``` +### Example Usage: Status (open) & source modified date + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListBillsRequest req = new ListBillsRequest() { + 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", +}; + +var res = await sdk.Bills.ListAsync(req); + +// handle response +``` +### Example Usage: Status (partially paid) + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListBillsRequest req = new ListBillsRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + Query = "status=PartiallyPaid", +}; + +var res = await sdk.Bills.ListAsync(req); + +// handle response +``` +### Example Usage: Status (partially paid) & source modified date + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -81,6 +188,7 @@ ListBillsRequest req = new ListBillsRequest() { 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", }; var res = await sdk.Bills.ListAsync(req); @@ -102,7 +210,8 @@ var res = await sdk.Bills.ListAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create @@ -111,12 +220,92 @@ The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-p [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. -### Example Usage +### Example Usage: Create bill + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; +using System.Collections.Generic; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateBillRequest req = new CreateBillRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillPrototype = new BillPrototype() { + Reference = "bill_b8qmmj4ksf1suax", + SupplierRef = new 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 = 1M, + LineItems = new List() { + new BillLineItem() { + Description = "Half day training - Microsoft Office", + UnitAmount = 1800M, + Quantity = 1M, + TaxAmount = 360M, + AccountRef = new BillAccountRef() { + Id = "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + TotalAmount = 2160M, + TaxRateRef = new BillTaxRateRef() { + Id = "INPUT2", + }, + }, + new BillLineItem() { + Description = "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", + UnitAmount = 4000M, + Quantity = 1M, + TaxAmount = 800M, + AccountRef = new BillAccountRef() { + Id = "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + TotalAmount = 4800M, + TaxRateRef = new BillTaxRateRef() { + Id = "INPUT2", + }, + }, + new BillLineItem() { + Description = "Stationery charges", + UnitAmount = 32M, + Quantity = 8M, + TaxAmount = 51.2M, + AccountRef = new BillAccountRef() { + Id = "cba6527d-f102-4538-b421-e483233e9d5a", + }, + TotalAmount = 307.2M, + TaxRateRef = new BillTaxRateRef() { + Id = "INPUT2", + }, + TrackingRefs = new List() { + new TrackingRef() { + Id = "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + DataType = DataType.TrackingCategories, + }, + }, + }, + }, + Status = BillStatus.Open, + }, +}; + +var res = await sdk.Bills.CreateAsync(req); + +// handle response +``` +### Example Usage: Created bill + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; using System.Collections.Generic; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -130,8 +319,47 @@ CreateBillRequest req = new CreateBillRequest() { }, IssueDate = "2022-10-23T00:00:00Z", DueDate = "2022-10-23T00:00:00Z", - Currency = "USD", - Status = Codat.Sync.Payables.Models.Components.BillStatus.Open, + Currency = "GBP", + LineItems = new List() { + new BillLineItem() { + TrackingRefs = null, + }, + }, + Status = BillStatus.Open, + }, +}; + +var res = await sdk.Bills.CreateAsync(req); + +// handle response +``` +### Example Usage: Malformed query + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; +using System.Collections.Generic; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateBillRequest req = new CreateBillRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillPrototype = new BillPrototype() { + SupplierRef = new SupplierRef() { + Id = "", + }, + IssueDate = "2022-10-23T00:00:00Z", + DueDate = "2022-10-23T00:00:00Z", + Currency = "GBP", + LineItems = new List() { + new BillLineItem() { + TrackingRefs = null, + }, + }, + Status = BillStatus.Open, }, }; @@ -154,28 +382,213 @@ var res = await sdk.Bills.CreateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.SDKException | 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 + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; +using System.Collections.Generic; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +UpdateBillRequest req = new UpdateBillRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", + BillPrototype = new BillPrototype() { + SupplierRef = new SupplierRef() { + Id = "", + }, + IssueDate = "2022-10-23T00:00:00Z", + DueDate = "2022-10-23T00:00:00Z", + Currency = "GBP", + LineItems = new List() { + new BillLineItem() { + TrackingRefs = new List() { + new TrackingRef() { + Id = "e9a1b63d-9ff0-40e7-8038-016354b987e6", + DataType = DataType.TrackingCategories, + }, + }, + }, + }, + Status = BillStatus.Open, + }, +}; + +var res = await sdk.Bills.UpdateAsync(req); + +// handle response +``` +### Example Usage: Update bill + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; +using System.Collections.Generic; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +UpdateBillRequest req = new UpdateBillRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", + BillPrototype = new BillPrototype() { + Reference = "bill_updated_ref", + SupplierRef = new SupplierRef() { + Id = "1262c350-fe0f-40ec-aeff-41c95b4a45af", + }, + IssueDate = "2023-04-23T00:00:00", + DueDate = "2023-05-23T00:00:00", + Currency = "GBP", + CurrencyRate = 1M, + LineItems = new List() { + new BillLineItem() { + Description = "Updated line item - Microsoft Office training", + UnitAmount = 2000M, + Quantity = 1M, + TaxAmount = 400M, + AccountRef = new BillAccountRef() { + Id = "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + TotalAmount = 2400M, + TaxRateRef = new BillTaxRateRef() { + Id = "INPUT2", + }, + }, + new BillLineItem() { + Description = "Desktop/network support via email & phone - updated rate", + UnitAmount = 4500M, + Quantity = 1M, + TaxAmount = 900M, + AccountRef = new BillAccountRef() { + Id = "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + TotalAmount = 5400M, + TaxRateRef = new BillTaxRateRef() { + Id = "INPUT2", + }, + TrackingRefs = new List() { + new TrackingRef() { + Id = "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + DataType = DataType.TrackingCategories, + }, + }, + }, + }, + Status = BillStatus.Open, + }, +}; + +var res = await sdk.Bills.UpdateAsync(req); + +// handle response +``` +### Example Usage: Updated bill + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; +using System.Collections.Generic; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +UpdateBillRequest req = new UpdateBillRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", + BillPrototype = new BillPrototype() { + SupplierRef = new SupplierRef() { + Id = "", + }, + IssueDate = "2022-10-23T00:00:00Z", + DueDate = "2022-10-23T00:00:00Z", + Currency = "GBP", + LineItems = new List() { + new BillLineItem() { + TrackingRefs = new List() { + new TrackingRef() { + Id = "e9a1b63d-9ff0-40e7-8038-016354b987e6", + DataType = DataType.TrackingCategories, + }, + }, + }, + }, + Status = BillStatus.Open, + }, +}; + +var res = await sdk.Bills.UpdateAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `request` | [UpdateBillRequest](../../Models/Requests/UpdateBillRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[UpdateBillResponse](../../Models/Requests/UpdateBillResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## UploadAttachment -The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. - +The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); UploadBillAttachmentRequest req = new UploadBillAttachmentRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", - BillId = "EILBDVJVNUAGVKRQ", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", }; var res = await sdk.Bills.UploadAttachmentAsync(req); @@ -197,28 +610,30 @@ var res = await sdk.Bills.UploadAttachmentAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## ListAttachments -The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. - +The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListBillAttachmentsRequest req = new ListBillAttachmentsRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", - BillId = "EILBDVJVNUAGVKRQ", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", }; var res = await sdk.Bills.ListAttachmentsAsync(req); @@ -240,7 +655,8 @@ var res = await sdk.Bills.ListAttachmentsAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## DownloadAttachment @@ -254,17 +670,18 @@ Check out our [coverage explorer](https://knowledge.codat.io/supported-features/ ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); DownloadBillAttachmentRequest req = new DownloadBillAttachmentRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", - BillId = "EILBDVJVNUAGVKRQ", + BillId = "13d946f0-c5d5-42bc-b092-97ece17923ab", AttachmentId = "8a210b68-6988-11ed-a1eb-0242ac120002", }; @@ -287,5 +704,6 @@ var res = await sdk.Bills.DownloadAttachmentAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/codatsyncpayables/README.md b/sync-for-payables/docs/sdks/codatsyncpayables/README.md deleted file mode 100644 index 48d6c7553..000000000 --- a/sync-for-payables/docs/sdks/codatsyncpayables/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# CodatSyncPayables SDK - -## Overview - -Bill pay kit: The API reference for the Bill Pay kit. - -The bill pay kit is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. - -[Explore product](https://docs.codat.io/payables/bill-pay-kit) | [See OpenAPI spec](https://github.com/codatio/oas) - ---- -## Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Oracle NetSuite | Yes | -| Xero | Yes | - ---- - -## Endpoints - -| Endpoints | Description | -| :- |:- | -| Companies | Create and manage your SMB users' companies. | -| Connections | Create new and manage existing data connections for a company. | -| Company information | View company profile from the source platform. | -| Bills | Get, create, and update Bills. | -| Bill payments | Get, create, and update Bill payments. | -| Suppliers | Get, create, and update Suppliers. | -| Bank accounts | Create a bank account for a given company's connection. | - - -### Available Operations diff --git a/sync-for-payables/docs/sdks/companies/README.md b/sync-for-payables/docs/sdks/companies/README.md index b340331d3..6db449b0a 100644 --- a/sync-for-payables/docs/sdks/companies/README.md +++ b/sync-for-payables/docs/sdks/companies/README.md @@ -1,5 +1,4 @@ # Companies -(*Companies*) ## Overview @@ -9,6 +8,7 @@ Create and manage your SMB users' companies. * [List](#list) - List companies * [Create](#create) - Create company +* [Replace](#replace) - Replace company * [Update](#update) - Update company * [Delete](#delete) - Delete a company * [Get](#get) - Get company @@ -20,20 +20,53 @@ Create and manage your SMB users' companies. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. -### Example Usage +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` +### Example Usage: List of Companies + + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListCompaniesRequest req = new ListCompaniesRequest() { + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", +}; + +var res = await sdk.Companies.ListAsync(req); + +// handle response +``` +### Example Usage: One company + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -55,7 +88,8 @@ var res = await sdk.Companies.ListAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create @@ -67,12 +101,48 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. -### Example Usage +### Example Usage: Malformed query + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CompanyRequestBody req = new CompanyRequestBody() { + Name = "Bank of Dave", + Description = "Requested early access to the new financing scheme.", +}; + +var res = await sdk.Companies.CreateAsync(req); + +// handle response +``` +### Example Usage: With a description + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CompanyRequestBody req = new CompanyRequestBody() { + Name = "Technicalium", + Description = "Technology services, including web and app design and development", +}; + +var res = await sdk.Companies.CreateAsync(req); + +// handle response +``` +### Example Usage: With a tag + + ```csharp using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; -using System.Collections.Generic; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -83,6 +153,23 @@ CompanyRequestBody req = new CompanyRequestBody() { var res = await sdk.Companies.CreateAsync(req); +// handle response +``` +### Example Usage: With no description + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CompanyRequestBody req = new CompanyRequestBody() { + Name = "Technicalium", +}; + +var res = await sdk.Companies.CreateAsync(req); + // handle response ``` @@ -100,29 +187,122 @@ var res = await sdk.Companies.CreateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | -## Update +## Replace -Use the *Update company* endpoint to update both the name and description of the company. +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. -### Example Usage +### Example Usage: Unauthorized + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ReplaceCompanyRequest req = new ReplaceCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + CompanyRequestBody = new CompanyRequestBody() { + Name = "Bank of Dave", + Description = "Requested early access to the new financing scheme.", + }, +}; + +var res = await sdk.Companies.ReplaceAsync(req); + +// handle response +``` +### Example Usage: Update description + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; -using System.Collections.Generic; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); -UpdateCompanyRequest req = new UpdateCompanyRequest() { +ReplaceCompanyRequest req = new ReplaceCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + CompanyRequestBody = new CompanyRequestBody() { + Name = "Same name", + Description = "Additional documents required", + }, +}; + +var res = await sdk.Companies.ReplaceAsync(req); + +// handle response +``` +### Example Usage: Update name + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ReplaceCompanyRequest req = new ReplaceCompanyRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyRequestBody = new CompanyRequestBody() { + Name = "New Name", + }, +}; + +var res = await sdk.Companies.ReplaceAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `request` | [ReplaceCompanyRequest](../../Models/Requests/ReplaceCompanyRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[ReplaceCompanyResponse](../../Models/Requests/ReplaceCompanyResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.SDKException | 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 + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +UpdateCompanyRequest req = new UpdateCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + CompanyUpdateRequest = new CompanyUpdateRequest() { Name = "Bank of Dave", Description = "Requested early access to the new financing scheme.", }, @@ -130,6 +310,51 @@ UpdateCompanyRequest req = new UpdateCompanyRequest() { var res = await sdk.Companies.UpdateAsync(req); +// handle response +``` +### Example Usage: Update name + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +UpdateCompanyRequest req = new UpdateCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + CompanyUpdateRequest = new CompanyUpdateRequest() { + Name = "New Name", + }, +}; + +var res = await sdk.Companies.UpdateAsync(req); + +// handle response +``` +### Example Usage: Update tags + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; +using System.Collections.Generic; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +UpdateCompanyRequest req = new UpdateCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + CompanyUpdateRequest = new CompanyUpdateRequest() { + Tags = new Dictionary() { + { "refrence", "new reference" }, + }, + }, +}; + +var res = await sdk.Companies.UpdateAsync(req); + // handle response ``` @@ -147,7 +372,8 @@ var res = await sdk.Companies.UpdateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Delete @@ -160,10 +386,11 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -190,7 +417,8 @@ var res = await sdk.Companies.DeleteAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Get @@ -201,12 +429,49 @@ A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) repres Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. -### Example Usage +### Example Usage: Parent multi-entity company + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +GetCompanyRequest req = new GetCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", +}; + +var res = await sdk.Companies.GetAsync(req); +// handle response +``` +### Example Usage: Simple company + + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +GetCompanyRequest req = new GetCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", +}; + +var res = await sdk.Companies.GetAsync(req); + +// handle response +``` +### Example Usage: Subsidiary multi-entity company + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -233,5 +498,6 @@ var res = await sdk.Companies.GetAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 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 f842a262e..9cbe4503b 100644 --- a/sync-for-payables/docs/sdks/companyinformation/README.md +++ b/sync-for-payables/docs/sdks/companyinformation/README.md @@ -1,5 +1,4 @@ # CompanyInformation -(*CompanyInformation*) ## Overview @@ -17,10 +16,11 @@ Use the *Get company information* endpoint to return information about the compa ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -48,5 +48,6 @@ var res = await sdk.CompanyInformation.GetAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 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 aed17d75d..9c618764b 100644 --- a/sync-for-payables/docs/sdks/connections/README.md +++ b/sync-for-payables/docs/sdks/connections/README.md @@ -1,5 +1,4 @@ # Connections -(*Connections*) ## Overview @@ -19,17 +18,16 @@ Create new and manage existing data connections for a company. ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListConnectionsRequest req = new ListConnectionsRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", }; @@ -53,7 +51,8 @@ var res = await sdk.Connections.ListAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create @@ -62,12 +61,34 @@ var res = await sdk.Connections.ListAsync(req); Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. -### Example Usage +### Example Usage: Connection + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateConnectionRequest req = new CreateConnectionRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + RequestBody = new CreateConnectionRequestBody() { + PlatformKey = "gbol", + }, +}; + +var res = await sdk.Connections.CreateAsync(req); + +// handle response +``` +### Example Usage: Unauthorized + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -97,7 +118,8 @@ var res = await sdk.Connections.CreateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Get @@ -106,10 +128,11 @@ var res = await sdk.Connections.CreateAsync(req); ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -137,7 +160,8 @@ var res = await sdk.Connections.GetAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Delete @@ -147,10 +171,11 @@ This operation is not reversible. The end user would need to reauthorize a new d ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -178,7 +203,8 @@ var res = await sdk.Connections.DeleteAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Unlink @@ -187,16 +213,20 @@ var res = await sdk.Connections.DeleteAsync(req); ### Example Usage + ```csharp using Codat.Sync.Payables; -using Codat.Sync.Payables.Models.Requests; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); UnlinkConnectionRequest req = new UnlinkConnectionRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + RequestBody = new UnlinkConnectionUpdateConnection() { + Status = DataConnectionStatus.Unlinked, + }, }; var res = await sdk.Connections.UnlinkAsync(req); @@ -218,5 +248,6 @@ var res = await sdk.Connections.UnlinkAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 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 859fc931f..0e1124abf 100644 --- a/sync-for-payables/docs/sdks/suppliers/README.md +++ b/sync-for-payables/docs/sdks/suppliers/README.md @@ -1,5 +1,4 @@ # Suppliers -(*Suppliers*) ## Overview @@ -20,12 +19,118 @@ By default, this endpoint returns a list of active and archived suppliers. You c For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. -### Example Usage +### Example Usage: Source modified date + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListSuppliersRequest req = new ListSuppliersRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + Query = "sourceModifiedDate>2023-12-15T00:00:00.000Z", +}; + +var res = await sdk.Suppliers.ListAsync(req); + +// handle response +``` +### Example Usage: Status (active) + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListSuppliersRequest req = new ListSuppliersRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + Query = "status=Active", +}; + +var res = await sdk.Suppliers.ListAsync(req); + +// handle response +``` +### Example Usage: Status (active) & source modified date + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListSuppliersRequest req = new ListSuppliersRequest() { + 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", +}; + +var res = await sdk.Suppliers.ListAsync(req); + +// handle response +``` +### Example Usage: Status (archived) + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListSuppliersRequest req = new ListSuppliersRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ContinuationToken = "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + Query = "status=Archived", +}; + +var res = await sdk.Suppliers.ListAsync(req); + +// handle response +``` +### Example Usage: Status (archived) & source modified date + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ListSuppliersRequest req = new ListSuppliersRequest() { + 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", +}; + +var res = await sdk.Suppliers.ListAsync(req); + +// handle response +``` +### Example Usage: Suppliers + + +```csharp +using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -54,22 +159,48 @@ var res = await sdk.Suppliers.ListAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create -The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. +The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. -### Example Usage +### Example Usage: Malformed query + ```csharp using Codat.Sync.Payables; +using Codat.Sync.Payables.Models.Components; using Codat.Sync.Payables.Models.Requests; + +var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +CreateSupplierRequest req = new CreateSupplierRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + SupplierPrototype = new SupplierPrototype() { + SupplierName = "", + Phone = "+44 25691 154789", + Status = SupplierStatus.Unknown, + }, +}; + +var res = await sdk.Suppliers.CreateAsync(req); + +// handle response +``` +### Example Usage: Suppliers + + +```csharp +using Codat.Sync.Payables; using Codat.Sync.Payables.Models.Components; +using Codat.Sync.Payables.Models.Requests; using System.Collections.Generic; var sdk = new CodatSyncPayables(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -78,9 +209,23 @@ CreateSupplierRequest req = new CreateSupplierRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", SupplierPrototype = new SupplierPrototype() { - SupplierName = "", - Phone = "(877) 492-8687", - Status = Codat.Sync.Payables.Models.Components.SupplierStatus.Active, + SupplierName = "Greggs", + ContactName = "Greg Greggs", + EmailAddress = "greg@greggs.com", + Phone = "+44 (0)1223 322410", + Addresses = new List
() { + new Address() { + Type = AddressType.Billing, + Line1 = "Flat 1", + Line2 = "2 Dennis Avenue", + City = "London", + Region = "Camden", + Country = "GBR", + PostalCode = "EC1N 7TE", + }, + }, + Status = SupplierStatus.Active, + DefaultCurrency = "GBP", }, }; @@ -103,5 +248,6 @@ var res = await sdk.Suppliers.CreateAsync(req); | Error Type | Status Code | Content Type | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Sync.Payables.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Sync.Payables.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file