From 435eaecbce452dbc7e1ea4fdb5896f7d82efeb34 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 26 Nov 2024 15:27:15 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.446.1 --- .speakeasy/workflow.lock | 13 +- bank-feeds/.speakeasy/gen.lock | 152 +++++++-- bank-feeds/.speakeasy/gen.yaml | 3 +- bank-feeds/README.md | 70 +--- bank-feeds/RELEASES.md | 12 +- bank-feeds/build.gradle | 7 +- .../models/components/BankTransactions.md | 6 +- bank-feeds/docs/models/components/Company.md | 2 + .../models/components/CompanyAccessToken.md | 12 + bank-feeds/docs/models/components/Result.md | 9 + .../SourceAccountBatchCreateResponse.md | 11 + .../SourceAccountBatchErrorResponse.md | 11 + .../SourceAccountV2BatchCreateResponse.md | 11 + .../operations/CreateBatchSourceAccount1.md | 2 + .../CreateBatchSourceAccountRequest.md | 10 + .../CreateBatchSourceAccountRequestBody.md | 2 + .../CreateBatchSourceAccountResponse.md | 12 + .../CreateBatchSourceAccountResponseBody.md | 4 + ...SourceAccountSourceAccountsResponseBody.md | 4 + .../operations/GenerateCredentialsResponse.md | 12 +- .../GetCompanyAccessTokenRequest.md | 8 + .../GetCompanyAccessTokenResponse.md | 11 + .../GetCreateBankTransactionsModelRequest.md | 10 + .../GetCreateBankTransactionsModelResponse.md | 11 + bank-feeds/docs/models/operations/One.md | 2 + bank-feeds/docs/sdks/accountmapping/README.md | 21 ++ bank-feeds/docs/sdks/codatbankfeeds/README.md | 4 +- bank-feeds/docs/sdks/companies/README.md | 57 ++++ bank-feeds/docs/sdks/sourceaccounts/README.md | 112 +++++-- bank-feeds/docs/sdks/transactions/README.md | 72 +++- .../io/codat/bank_feeds/AccountMapping.java | 63 ++++ .../java/io/codat/bank_feeds/Companies.java | 177 ++++++++++ .../io/codat/bank_feeds/SDKConfiguration.java | 4 +- .../io/codat/bank_feeds/SourceAccounts.java | 278 ++++++++++++---- .../io/codat/bank_feeds/Transactions.java | 204 +++++++++++- .../models/components/BankTransactions.java | 135 ++++++-- .../bank_feeds/models/components/Company.java | 106 +++++- .../models/components/CompanyAccessToken.java | 187 +++++++++++ .../bank_feeds/models/components/Result.java | 187 +++++++++++ .../SourceAccountBatchCreateResponse.java | 192 +++++++++++ .../SourceAccountBatchErrorResponse.java | 174 ++++++++++ .../SourceAccountV2BatchCreateResponse.java | 192 +++++++++++ .../operations/CreateBatchSourceAccount1.java | 107 ++++++ .../CreateBatchSourceAccountRequest.java | 192 +++++++++++ .../CreateBatchSourceAccountRequestBody.java | 100 ++++++ ...reateBatchSourceAccountRequestBuilder.java | 48 +++ .../CreateBatchSourceAccountResponse.java | 310 ++++++++++++++++++ .../CreateBatchSourceAccountResponseBody.java | 94 ++++++ ...urceAccountSourceAccountsResponseBody.java | 94 ++++++ .../GetCompanyAccessTokenRequest.java | 101 ++++++ .../GetCompanyAccessTokenRequestBuilder.java | 48 +++ .../GetCompanyAccessTokenResponse.java | 252 ++++++++++++++ ...GetCreateBankTransactionsModelRequest.java | 183 +++++++++++ ...teBankTransactionsModelRequestBuilder.java | 48 +++ ...etCreateBankTransactionsModelResponse.java | 252 ++++++++++++++ .../bank_feeds/models/operations/One.java | 99 ++++++ .../operations/SDKMethodInterfaces.java | 21 ++ .../codat/bank_feeds/utils/HTTPRequest.java | 68 +++- .../bank_feeds/utils/PathParamsMetadata.java | 4 +- .../bank_feeds/utils/QueryParameter.java | 62 ++++ .../bank_feeds/utils/QueryParameters.java | 59 ++-- .../bank_feeds/utils/QueryParamsMetadata.java | 4 +- .../io/codat/bank_feeds/utils/Security.java | 2 +- .../bank_feeds/utils/Utf8UrlEncoder.java | 117 +++++++ .../java/io/codat/bank_feeds/utils/Utils.java | 67 ++-- 65 files changed, 4594 insertions(+), 310 deletions(-) create mode 100644 bank-feeds/docs/models/components/CompanyAccessToken.md create mode 100644 bank-feeds/docs/models/components/Result.md create mode 100644 bank-feeds/docs/models/components/SourceAccountBatchCreateResponse.md create mode 100644 bank-feeds/docs/models/components/SourceAccountBatchErrorResponse.md create mode 100644 bank-feeds/docs/models/components/SourceAccountV2BatchCreateResponse.md create mode 100644 bank-feeds/docs/models/operations/CreateBatchSourceAccount1.md create mode 100644 bank-feeds/docs/models/operations/CreateBatchSourceAccountRequest.md create mode 100644 bank-feeds/docs/models/operations/CreateBatchSourceAccountRequestBody.md create mode 100644 bank-feeds/docs/models/operations/CreateBatchSourceAccountResponse.md create mode 100644 bank-feeds/docs/models/operations/CreateBatchSourceAccountResponseBody.md create mode 100644 bank-feeds/docs/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.md create mode 100644 bank-feeds/docs/models/operations/GetCompanyAccessTokenRequest.md create mode 100644 bank-feeds/docs/models/operations/GetCompanyAccessTokenResponse.md create mode 100644 bank-feeds/docs/models/operations/GetCreateBankTransactionsModelRequest.md create mode 100644 bank-feeds/docs/models/operations/GetCreateBankTransactionsModelResponse.md create mode 100644 bank-feeds/docs/models/operations/One.md create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/components/CompanyAccessToken.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Result.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchCreateResponse.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchErrorResponse.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2BatchCreateResponse.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccount1.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java create mode 100644 bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index e209f5f7..43c73b6c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -9,11 +9,12 @@ sources: - main bank-feeds-source: sourceNamespace: bank-feeds-source - sourceRevisionDigest: sha256:a6479feafb8f4f49461fb9347578ab34619bcba818605cb5ab74f241dc1eb328 - sourceBlobDigest: sha256:a490b555d6f186cd37f72a06e06ba49293a0f371d145db2d9913d5081ecfc5a2 + sourceRevisionDigest: sha256:b03ce9653088911fcc62e4160ee189c580f351aa25dfe56b5d05f5a7b96f35aa + sourceBlobDigest: sha256:b5233f0bab180b8aae271a0d5ab149316931ec9e84a140e1c073a2025305eb7d tags: - latest - - main + - speakeasy-sdk-regen-1732634784 + - 3.0.0 banking-source: sourceNamespace: banking-source sourceRevisionDigest: sha256:ba6aa66d7b50ed4631adca7711ffdf2a76270842ca4be92413d92c5644116692 @@ -73,8 +74,10 @@ targets: bank-feeds-library: source: bank-feeds-source sourceNamespace: bank-feeds-source - sourceRevisionDigest: sha256:a6479feafb8f4f49461fb9347578ab34619bcba818605cb5ab74f241dc1eb328 - sourceBlobDigest: sha256:a490b555d6f186cd37f72a06e06ba49293a0f371d145db2d9913d5081ecfc5a2 + sourceRevisionDigest: sha256:b03ce9653088911fcc62e4160ee189c580f351aa25dfe56b5d05f5a7b96f35aa + sourceBlobDigest: sha256:b5233f0bab180b8aae271a0d5ab149316931ec9e84a140e1c073a2025305eb7d + codeSamplesNamespace: bank-feeds-source-code-samples + codeSamplesRevisionDigest: sha256:76973441342874ccd37043d74d4eb34f717f8ba1b646f565e53788b44b77fe1d banking-library: source: banking-source sourceNamespace: banking-source diff --git a/bank-feeds/.speakeasy/gen.lock b/bank-feeds/.speakeasy/gen.lock index 9958f563..f44b7083 100755 --- a/bank-feeds/.speakeasy/gen.lock +++ b/bank-feeds/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 1f92decd-6f40-4ee5-936f-9c85d706eb7e management: - docChecksum: c57bceaa5f2d5b6d55426976a49ec69d + docChecksum: af010093774a298b2b6a17e641f9cd1b docVersion: 3.0.0 - speakeasyVersion: 1.431.0 - generationVersion: 2.451.0 - releaseVersion: 1.0.0 - configChecksum: e9dddd187545257ee4cbe11d552f73a9 + speakeasyVersion: 1.446.1 + generationVersion: 2.462.1 + releaseVersion: 2.0.0 + configChecksum: f6e6094b040d561de33cfde4a6af8af4 repoURL: https://github.com/codatio/client-sdk-java.git repoSubDirectory: bank-feeds published: true @@ -14,7 +14,7 @@ features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.30.7 + core: 3.32.2 decimal: 0.0.1 deprecations: 2.81.1 examples: 2.81.3 @@ -27,7 +27,7 @@ features: nullables: 0.1.0 retries: 0.1.1 sdkHooks: 0.1.0 - tests: 0.1.0 + serverEventsSentinels: 0.2.0 unions: 0.0.6 webhooks: 1.0.0 generatedFiles: @@ -63,6 +63,7 @@ generatedFiles: - docs/models/components/ClientRateLimitWebhookPayload.md - docs/models/components/Companies.md - docs/models/components/Company.md + - docs/models/components/CompanyAccessToken.md - docs/models/components/CompanyInformation.md - docs/models/components/CompanyReference.md - docs/models/components/CompanyReferenceLinks.md @@ -98,10 +99,14 @@ generatedFiles: - docs/models/components/PushOptionProperty.md - docs/models/components/PushOptionType.md - docs/models/components/PushValidationInfo.md + - docs/models/components/Result.md - docs/models/components/RoutingInfo.md - docs/models/components/Security.md - docs/models/components/SourceAccount.md + - docs/models/components/SourceAccountBatchCreateResponse.md + - docs/models/components/SourceAccountBatchErrorResponse.md - docs/models/components/SourceAccountV2.md + - docs/models/components/SourceAccountV2BatchCreateResponse.md - docs/models/components/SourceAccountV2Status.md - docs/models/components/SourceAccountWebhook.md - docs/models/components/SourceAccountWebhookPayload.md @@ -122,6 +127,12 @@ generatedFiles: - docs/models/operations/CreateBankAccountResponse.md - docs/models/operations/CreateBankTransactionsRequest.md - docs/models/operations/CreateBankTransactionsResponse.md + - docs/models/operations/CreateBatchSourceAccount1.md + - docs/models/operations/CreateBatchSourceAccountRequest.md + - docs/models/operations/CreateBatchSourceAccountRequestBody.md + - docs/models/operations/CreateBatchSourceAccountResponse.md + - docs/models/operations/CreateBatchSourceAccountResponseBody.md + - docs/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.md - docs/models/operations/CreateCompanyResponse.md - docs/models/operations/CreateConnectionRequest.md - docs/models/operations/CreateConnectionRequestBody.md @@ -142,6 +153,8 @@ generatedFiles: - docs/models/operations/GenerateCredentialsResponse.md - docs/models/operations/GetBankAccountMappingRequest.md - docs/models/operations/GetBankAccountMappingResponse.md + - docs/models/operations/GetCompanyAccessTokenRequest.md + - docs/models/operations/GetCompanyAccessTokenResponse.md - docs/models/operations/GetCompanyInformationRequest.md - docs/models/operations/GetCompanyInformationResponse.md - docs/models/operations/GetCompanyRequest.md @@ -152,6 +165,8 @@ generatedFiles: - docs/models/operations/GetConnectionResponse.md - docs/models/operations/GetCreateBankAccountsModelRequest.md - docs/models/operations/GetCreateBankAccountsModelResponse.md + - docs/models/operations/GetCreateBankTransactionsModelRequest.md + - docs/models/operations/GetCreateBankTransactionsModelResponse.md - docs/models/operations/GetCreateOperationRequest.md - docs/models/operations/GetCreateOperationResponse.md - docs/models/operations/GetLastSuccessfulRequest.md @@ -167,6 +182,7 @@ generatedFiles: - docs/models/operations/ListSourceAccountsRequest.md - docs/models/operations/ListSourceAccountsResponse.md - docs/models/operations/ListSourceAccountsResponseBody.md + - docs/models/operations/One.md - docs/models/operations/SetConfigurationRequest.md - docs/models/operations/SetConfigurationResponse.md - docs/models/operations/UnlinkConnectionRequest.md @@ -237,6 +253,7 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/models/components/ClientRateLimitWebhookPayload.java - src/main/java/io/codat/bank_feeds/models/components/Companies.java - src/main/java/io/codat/bank_feeds/models/components/Company.java + - src/main/java/io/codat/bank_feeds/models/components/CompanyAccessToken.java - src/main/java/io/codat/bank_feeds/models/components/CompanyInformation.java - src/main/java/io/codat/bank_feeds/models/components/CompanyReference.java - src/main/java/io/codat/bank_feeds/models/components/CompanyReferenceLinks.java @@ -272,10 +289,14 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/models/components/PushOptionProperty.java - src/main/java/io/codat/bank_feeds/models/components/PushOptionType.java - src/main/java/io/codat/bank_feeds/models/components/PushValidationInfo.java + - src/main/java/io/codat/bank_feeds/models/components/Result.java - src/main/java/io/codat/bank_feeds/models/components/RoutingInfo.java - src/main/java/io/codat/bank_feeds/models/components/Security.java - src/main/java/io/codat/bank_feeds/models/components/SourceAccount.java + - src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchCreateResponse.java + - src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchErrorResponse.java - src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2.java + - src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2BatchCreateResponse.java - src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2Status.java - src/main/java/io/codat/bank_feeds/models/components/SourceAccountWebhook.java - src/main/java/io/codat/bank_feeds/models/components/SourceAccountWebhookPayload.java @@ -301,6 +322,13 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/models/operations/CreateBankTransactionsRequest.java - src/main/java/io/codat/bank_feeds/models/operations/CreateBankTransactionsRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/CreateBankTransactionsResponse.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccount1.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java + - src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java - src/main/java/io/codat/bank_feeds/models/operations/CreateCompanyRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/CreateCompanyResponse.java - src/main/java/io/codat/bank_feeds/models/operations/CreateConnectionRequest.java @@ -330,6 +358,9 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/models/operations/GetBankAccountMappingRequest.java - src/main/java/io/codat/bank_feeds/models/operations/GetBankAccountMappingRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/GetBankAccountMappingResponse.java + - src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java + - src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java + - src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java - src/main/java/io/codat/bank_feeds/models/operations/GetCompanyInformationRequest.java - src/main/java/io/codat/bank_feeds/models/operations/GetCompanyInformationRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/GetCompanyInformationResponse.java @@ -345,6 +376,9 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankAccountsModelRequest.java - src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankAccountsModelRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankAccountsModelResponse.java + - src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java + - src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java + - src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java - src/main/java/io/codat/bank_feeds/models/operations/GetCreateOperationRequest.java - src/main/java/io/codat/bank_feeds/models/operations/GetCreateOperationRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/GetCreateOperationResponse.java @@ -367,6 +401,7 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/models/operations/ListSourceAccountsRequestBuilder.java - src/main/java/io/codat/bank_feeds/models/operations/ListSourceAccountsResponse.java - src/main/java/io/codat/bank_feeds/models/operations/ListSourceAccountsResponseBody.java + - src/main/java/io/codat/bank_feeds/models/operations/One.java - src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java - src/main/java/io/codat/bank_feeds/models/operations/SetConfigurationRequest.java - src/main/java/io/codat/bank_feeds/models/operations/SetConfigurationRequestBuilder.java @@ -409,6 +444,7 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/utils/OneOfDeserializer.java - src/main/java/io/codat/bank_feeds/utils/Options.java - src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java + - src/main/java/io/codat/bank_feeds/utils/QueryParameter.java - src/main/java/io/codat/bank_feeds/utils/QueryParameters.java - src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java - src/main/java/io/codat/bank_feeds/utils/RequestBody.java @@ -423,6 +459,7 @@ generatedFiles: - src/main/java/io/codat/bank_feeds/utils/SpeakeasyMetadata.java - src/main/java/io/codat/bank_feeds/utils/TypedObject.java - src/main/java/io/codat/bank_feeds/utils/Types.java + - src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java - src/main/java/io/codat/bank_feeds/utils/Utils.java examples: create-company: @@ -431,14 +468,14 @@ examples: application/json: {"description": "Requested early access to the new financing scheme.", "name": "Technicalium"} responses: "200": - application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} "400": {} With a description: requestBody: application/json: {"description": "Technology services, including web and app design and development", "name": "Technicalium"} responses: "200": - application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} "400": {} With a group: requestBody: @@ -458,7 +495,7 @@ examples: application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} responses: "200": - application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "tags": {"region": "us"}} + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [], "tags": {"region": "us"}} delete-company: Unauthorized: parameters: @@ -474,7 +511,7 @@ examples: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "My First Company", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Toft stores holdings", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} With groups: parameters: path: @@ -489,6 +526,20 @@ examples: responses: "401": application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + Parent multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]} + Subsidiary multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "description": "", "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []} list-companies: "": parameters: @@ -510,7 +561,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6"}], "totalResults": 1} + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "referenceSubsidiaryCompanies": []}], "totalResults": 1} List of Companies: parameters: query: @@ -520,7 +571,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002"}, {"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "a70bc148-dc21-46b2-a257-d9c58ac15cbb", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/096db70b-78de-4ff0-aa98-299cb5fe17a0/connections/a70bc148-dc21-46b2-a257-d9c58ac15cbb/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "A new digital agency with a passion for creating amazing digital experiences", "id": "096db70b-78de-4ff0-aa98-299cb5fe17a0", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Godata", "redirect": "https://link.codat.io/company/096db70b-78de-4ff0-aa98-299cb5fe17a0"}], "totalResults": 2} + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}], "totalResults": 3} Malformed query: parameters: query: @@ -550,7 +601,7 @@ examples: application/json: {"description": "Requested early access to the new financing scheme.", "name": "New Name"} responses: "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} "401": {} Update description: parameters: @@ -560,7 +611,7 @@ examples: application/json: {"description": "Additional documents required", "name": "Same name"} responses: "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} "401": {} Unauthorized: parameters: @@ -641,7 +692,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} + application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} Malformed query: parameters: path: @@ -724,7 +775,7 @@ examples: connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: "200": - application/json: [{"feedStartDate": "2022-10-23T00:00:00Z", "sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": "99.99", "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"accountNumber": "789", "id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456"}, {"accountNumber": "99887766", "id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866"}, {"accountNumber": "123456789", "id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456"}]}] + application/json: [{"sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": "99.99", "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"accountNumber": "789", "id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456"}, {"accountNumber": "99887766", "id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866"}, {"accountNumber": "123456789", "id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456"}]}] get-company-information: Malformed query: parameters: @@ -916,7 +967,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "55", "accountNumber": "", "accountType": "Unknown", "balance": -352.03, "currency": "GBP", "iBan": "", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "10500", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2023-02-07T00:00:00", "status": "Active"}, {"accountName": "555", "accountNumber": "", "accountType": "Unknown", "balance": 661.79, "currency": "PLN", "iBan": "", "id": "47020f80-60e6-ec11-82f8-0022481a77f0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "40300", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2022-06-07T00:00:00", "status": "Active"}], "totalResults": 28} + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "55", "accountNumber": "", "accountType": "Unknown", "balance": -352.03, "currency": "GBP", "iBan": "", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "10500", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2023-02-07T00:00:00"}, {"accountName": "555", "accountNumber": "", "accountType": "Unknown", "balance": 661.79, "currency": "PLN", "iBan": "", "id": "47020f80-60e6-ec11-82f8-0022481a77f0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "40300", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2022-06-07T00:00:00"}], "totalResults": 28} FreeAgent: parameters: path: @@ -929,7 +980,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\w3fw", "accountNumber": "A06268209", "accountType": "Debit", "availableBalance": -10484.65, "balance": -10484.65, "currency": "GBP", "id": "738783", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "2e2bna45hy\\", "accountNumber": "D01825250", "accountType": "Debit", "availableBalance": -114.4, "balance": -114.4, "currency": "GBP", "id": "738778", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 82} + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\w3fw", "accountNumber": "A06268209", "accountType": "Debit", "availableBalance": -10484.65, "balance": -10484.65, "currency": "GBP", "id": "738783", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972"}, {"accountName": "2e2bna45hy\\", "accountNumber": "D01825250", "accountType": "Debit", "availableBalance": -114.4, "balance": -114.4, "currency": "GBP", "id": "738778", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972"}], "totalResults": 82} KashFlow: parameters: path: @@ -942,7 +993,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "16th Account", "accountType": "Unknown", "availableBalance": 326, "balance": 326, "currency": "GBP", "id": "765768", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "1a1a", "accountType": "Unknown", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "765766", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70600", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 56} + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "16th Account", "accountType": "Unknown", "availableBalance": 326, "balance": 326, "currency": "GBP", "id": "765768", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70700"}, {"accountName": "1a1a", "accountType": "Unknown", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "765766", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70600"}], "totalResults": 56} Oracle NetSuite: parameters: path: @@ -955,7 +1006,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Codat Europe Bank", "accountType": "Debit", "balance": 558.22, "currency": "GBP", "id": "825", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "111111122222111", "sourceModifiedDate": "2022-07-15T11:34:02", "status": "Active"}, {"accountName": "Codat Europe Bank USD", "accountType": "Debit", "currency": "USD", "id": "826", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "1133221133", "sourceModifiedDate": "2021-03-26T10:31:40", "status": "Active"}], "totalResults": 4} + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Codat Europe Bank", "accountType": "Debit", "balance": 558.22, "currency": "GBP", "id": "825", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "111111122222111", "sourceModifiedDate": "2022-07-15T11:34:02"}, {"accountName": "Codat Europe Bank USD", "accountType": "Debit", "currency": "USD", "id": "826", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "1133221133", "sourceModifiedDate": "2021-03-26T10:31:40"}], "totalResults": 4} QuickBooks Desktop: parameters: path: @@ -968,7 +1019,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Checking", "accountType": "Unknown", "availableBalance": 46954.1, "balance": 46954.1, "currency": "GBP", "id": "20000-933270541", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"}, {"accountName": "Petty Cash", "accountType": "Unknown", "availableBalance": 500, "balance": 500, "currency": "GBP", "id": "550001-1071509830", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10400", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"}], "totalResults": 3} + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Checking", "accountType": "Unknown", "availableBalance": 46954.1, "balance": 46954.1, "currency": "GBP", "id": "20000-933270541", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45"}, {"accountName": "Petty Cash", "accountType": "Unknown", "availableBalance": 500, "balance": 500, "currency": "GBP", "id": "550001-1071509830", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10400", "sourceModifiedDate": "2023-12-16T05:06:45"}], "totalResults": 3} QuickBooks Online Sandbox: parameters: path: @@ -981,7 +1032,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "00", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "164", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "nominalCode": "123567", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"}, {"accountName": "11", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "163", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"}], "totalResults": 57} + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "00", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "164", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "nominalCode": "123567", "sourceModifiedDate": "2022-07-20T14:11:28Z"}, {"accountName": "11", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "163", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z"}], "totalResults": 57} QuickBooks Online: parameters: path: @@ -994,7 +1045,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\aa", "accountType": "Debit", "availableBalance": 123, "balance": 123, "currency": "GBP", "id": "202", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z", "status": "Active"}, {"accountName": "1 year ago", "accountType": "Debit", "availableBalance": 5300.02, "balance": 5300.02, "currency": "GBP", "id": "193", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2023-01-18T06:05:12Z", "status": "Active"}], "totalResults": 140} + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\aa", "accountType": "Debit", "availableBalance": 123, "balance": 123, "currency": "GBP", "id": "202", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z"}, {"accountName": "1 year ago", "accountType": "Debit", "availableBalance": 5300.02, "balance": 5300.02, "currency": "GBP", "id": "193", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2023-01-18T06:05:12Z"}], "totalResults": 140} Sage 50 (UK): parameters: path: @@ -1007,7 +1058,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Bank Current Account", "accountNumber": "003234234", "accountType": "Unknown", "availableBalance": -20091.04, "balance": -20091.04, "currency": "GBP", "iBan": "", "id": "1200", "institution": "Lloyds Bank PLC", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1200", "overdraftLimit": 120000, "sortCode": "23-34-34", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"}, {"accountName": "Bank Deposit Account", "accountNumber": "9/00474345", "accountType": "Unknown", "availableBalance": 3510, "balance": 3510, "currency": "GBP", "iBan": "", "id": "1210", "institution": "Halifax Building Society", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1210", "overdraftLimit": 0, "sortCode": "45-45-45", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"}], "totalResults": 6} + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Bank Current Account", "accountNumber": "003234234", "accountType": "Unknown", "availableBalance": -20091.04, "balance": -20091.04, "currency": "GBP", "iBan": "", "id": "1200", "institution": "Lloyds Bank PLC", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1200", "overdraftLimit": 120000, "sortCode": "23-34-34", "sourceModifiedDate": "2022-11-25T09:25:48"}, {"accountName": "Bank Deposit Account", "accountNumber": "9/00474345", "accountType": "Unknown", "availableBalance": 3510, "balance": 3510, "currency": "GBP", "iBan": "", "id": "1210", "institution": "Halifax Building Society", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1210", "overdraftLimit": 0, "sortCode": "45-45-45", "sourceModifiedDate": "2022-11-25T09:25:48"}], "totalResults": 6} Sage Business Cloud Accounting: parameters: path: @@ -1020,7 +1071,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Internet Bank", "accountNumber": "11111", "accountType": "Unknown", "availableBalance": 49.61, "balance": 49.61, "currency": "GBP", "id": "154d05abe9f24c4babe0f6a741dec1b9", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "1560", "sortCode": "010101", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active"}, {"accountName": "Abdi Live Test", "accountNumber": "1234567", "accountType": "Unknown", "availableBalance": -225830.75, "balance": -225830.75, "currency": "GBP", "id": "565ce07212bc492c8c2d04f43f9f67e3", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "147852", "sortCode": "123456", "sourceModifiedDate": "2020-01-28T14:00:20Z", "status": "Active"}], "totalResults": 45} + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Internet Bank", "accountNumber": "11111", "accountType": "Unknown", "availableBalance": 49.61, "balance": 49.61, "currency": "GBP", "id": "154d05abe9f24c4babe0f6a741dec1b9", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "1560", "sortCode": "010101", "sourceModifiedDate": "2020-01-27T10:53:26Z"}, {"accountName": "Abdi Live Test", "accountNumber": "1234567", "accountType": "Unknown", "availableBalance": -225830.75, "balance": -225830.75, "currency": "GBP", "id": "565ce07212bc492c8c2d04f43f9f67e3", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "147852", "sortCode": "123456", "sourceModifiedDate": "2020-01-28T14:00:20Z"}], "totalResults": 45} Sage Intacct: parameters: path: @@ -1033,7 +1084,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "CoT Credit Card", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:55", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "10021", "sourceModifiedDate": "2023-03-27T14:11:48", "status": "Active"}, {"accountName": "Cot Credit Card 2", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:58", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "11112", "sourceModifiedDate": "2023-03-27T14:15:11", "status": "Active"}], "totalResults": 14} + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "CoT Credit Card", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:55", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "10021", "sourceModifiedDate": "2023-03-27T14:11:48"}, {"accountName": "Cot Credit Card 2", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:58", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "11112", "sourceModifiedDate": "2023-03-27T14:15:11"}], "totalResults": 14} Xero: parameters: path: @@ -1046,7 +1097,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Business Bank Account", "accountNumber": "987654321", "accountType": "Debit", "balance": 6681.79, "currency": "GBP", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "990404", "sourceModifiedDate": "2023-03-15T20:35:07", "status": "Active"}, {"accountName": "Business Savings Account", "accountNumber": "876543210", "accountType": "Debit", "balance": 0, "currency": "GBP", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "890303", "sourceModifiedDate": "2023-03-15T20:36:06", "status": "Active"}], "totalResults": 2} + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Business Bank Account", "accountNumber": "987654321", "accountType": "Debit", "balance": 6681.79, "currency": "GBP", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "990404", "sourceModifiedDate": "2023-03-15T20:35:07"}, {"accountName": "Business Savings Account", "accountNumber": "876543210", "accountType": "Debit", "balance": 0, "currency": "GBP", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "890303", "sourceModifiedDate": "2023-03-15T20:36:06"}], "totalResults": 2} Zoho Books: parameters: path: @@ -1059,7 +1110,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Test", "accountNumber": "xxxx5678", "accountType": "Unknown", "balance": 69858.44, "currency": "GBP", "id": "104957000000060010", "institution": "Test Bank", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "112233", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "Abdi Test 2", "accountNumber": "", "accountType": "Unknown", "balance": 98.03, "currency": "AED", "id": "104957000000065002", "institution": "", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 4} + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Test", "accountNumber": "xxxx5678", "accountType": "Unknown", "balance": 69858.44, "currency": "GBP", "id": "104957000000060010", "institution": "Test Bank", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "112233"}, {"accountName": "Abdi Test 2", "accountNumber": "", "accountType": "Unknown", "balance": 98.03, "currency": "AED", "id": "104957000000065002", "institution": "", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": ""}], "totalResults": 4} Malformed query: parameters: path: @@ -1108,7 +1159,7 @@ examples: accountId: "7110701885" query: {} requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "counterparty": "ACME INC", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reconciled": false, "reference": "reference for transaction", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "counterparty": "ACME INC", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "counterparty": "ACME INC", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}]} + application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "transactionType": "Debit"}]} responses: "200": application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountId": "Checking 0202", "transactions": []}, "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "261915a2-5d0d-49ea-9320-e8504aa8ce67", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 775787} @@ -1121,7 +1172,7 @@ examples: accountId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" query: {} requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": -999.99, "counterparty": "ACME INC", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reconciled": false, "reference": "reference for transaction", "transactionType": "Credit"}, {"amount": -100, "balance": -999.99, "counterparty": "ACME INC", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}, {"amount": -60, "balance": -999.99, "counterparty": "ACME INC", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}]} + application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "transactionType": "Credit"}, {"amount": -100, "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "transactionType": "Debit"}, {"amount": -60, "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "transactionType": "Debit"}]} responses: "200": application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountId": "EILBDVJVNUAGVKRQ", "transactions": []}, "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "cf24bdeb-cfc2-43e7-96f9-415747251ef0", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 363328} @@ -1134,7 +1185,7 @@ examples: accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" query: {} requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "counterparty": "Bank of Example", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reconciled": false, "reference": "Ref-12345", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "counterparty": "Amazon", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reconciled": false, "reference": "Ref-12346", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "counterparty": "Office Mart", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reconciled": false, "reference": "Ref-12347", "transactionType": "Debit"}]} + application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "counterparty": "Bank of Example", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reference": "Ref-12345", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "counterparty": "Amazon", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reference": "Ref-12346", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "counterparty": "Office Mart", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reference": "Ref-12347", "transactionType": "Debit"}]} responses: "200": application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountId": "7110701885", "transactions": []}, "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "95835d6b-1b39-4d7e-a0de-fed8d063eda5", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 121860} @@ -1224,3 +1275,40 @@ examples: responses: "401": application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company-access-token: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accessToken": "string", "expiresIn": 86400, "tokenType": "Bearer"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-batch-source-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: [{"accountName": "account-081", "accountNumber": "12345670", "accountType": "Credit", "balance": 99.99, "currency": "GBP", "id": "acc-002", "modifiedDate": "2023-01-09T14:14:14.1057478Z", "sortCode": "123456", "status": "pending"}, {"accountName": "account-095", "accountNumber": "12345671", "accountType": "Credit", "balance": 0, "currency": "USD", "id": "acc-003", "modifiedDate": "2023-01-09T14:14:14.1057478Z", "sortCode": "123456", "status": "pending"}] + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-bank-transactions-model: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} +generatedTests: {} diff --git a/bank-feeds/.speakeasy/gen.yaml b/bank-feeds/.speakeasy/gen.yaml index 0b317518..8e7135b0 100644 --- a/bank-feeds/.speakeasy/gen.yaml +++ b/bank-feeds/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: oAuth2PasswordEnabled: false telemetryEnabled: true java: - version: 1.0.0 + version: 2.0.0 additionalDependencies: [] additionalPlugins: [] artifactID: bank-feeds @@ -21,6 +21,7 @@ java: companyEmail: support@codat.io companyName: Codat companyURL: https://www.codat.io/ + defaultErrorName: SDKError description: Set up bank feeds from accounts in your application to supported accounting platforms. flattenGlobalSecurity: true githubURL: github.com/codatio/client-sdk-java/bank-feeds diff --git a/bank-feeds/README.md b/bank-feeds/README.md index b6768827..d1e60aad 100644 --- a/bank-feeds/README.md +++ b/bank-feeds/README.md @@ -51,7 +51,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'io.codat:bank-feeds:1.0.0' +implementation 'io.codat:bank-feeds:2.0.0' ``` Maven: @@ -59,7 +59,7 @@ Maven: io.codat bank-feeds - 1.0.0 + 2.0.0 ``` @@ -141,6 +141,7 @@ public class Application { * [create](docs/sdks/companies/README.md#create) - Create company * [delete](docs/sdks/companies/README.md#delete) - Delete a company * [get](docs/sdks/companies/README.md#get) - Get company +* [getAccessToken](docs/sdks/companies/README.md#getaccesstoken) - Get company access token * [list](docs/sdks/companies/README.md#list) - List companies * [update](docs/sdks/companies/README.md#update) - Update company @@ -163,7 +164,8 @@ public class Application { ### [sourceAccounts()](docs/sdks/sourceaccounts/README.md) -* [create](docs/sdks/sourceaccounts/README.md#create) - Create source account +* [create](docs/sdks/sourceaccounts/README.md#create) - Create single source account +* [createBatch](docs/sdks/sourceaccounts/README.md#createbatch) - Create source accounts * [delete](docs/sdks/sourceaccounts/README.md#delete) - Delete source account * [deleteCredentials](docs/sdks/sourceaccounts/README.md#deletecredentials) - Delete all source account credentials * [generateCredentials](docs/sdks/sourceaccounts/README.md#generatecredentials) - Generate source account credentials @@ -177,6 +179,7 @@ public class Application { ### [transactions()](docs/sdks/transactions/README.md) * [create](docs/sdks/transactions/README.md#create) - Create bank transactions +* [getCreateModel](docs/sdks/transactions/README.md#getcreatemodel) - Get create bank transactions model * [getCreateOperation](docs/sdks/transactions/README.md#getcreateoperation) - Get create operation * [listCreateOperations](docs/sdks/transactions/README.md#listcreateoperations) - List create operations @@ -290,10 +293,10 @@ Handling errors in this SDK should largely match your expectations. All operatio By default, an API error will throw a `models/errors/SDKError` exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create` method throws the following exceptions: -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| models/errors/ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | -| models/errors/SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| -------------------------- | --------------------------------- | ---------------- | +| models/errors/ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | ### Example @@ -334,54 +337,9 @@ public class Application { ## Server Selection -### Select Server by Index - -You can override the default server globally by passing a server index to the `serverIndex` builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://api.codat.io` | None | - -#### Example - -```java -package hello.world; - -import io.codat.bank_feeds.CodatBankFeeds; -import io.codat.bank_feeds.models.components.CompanyRequestBody; -import io.codat.bank_feeds.models.errors.ErrorMessage; -import io.codat.bank_feeds.models.operations.CreateCompanyResponse; -import java.lang.Exception; - -public class Application { - - public static void main(String[] args) throws ErrorMessage, Exception { - - CodatBankFeeds sdk = CodatBankFeeds.builder() - .serverIndex(0) - .authHeader("Basic BASE_64_ENCODED(API_KEY)") - .build(); - - CompanyRequestBody req = CompanyRequestBody.builder() - .name("Bank of Dave") - .description("Requested early access to the new financing scheme.") - .build(); - - CreateCompanyResponse res = sdk.companies().create() - .request(req) - .call(); - - if (res.company().isPresent()) { - // handle response - } - } -} -``` - - ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverURL` builder method when initializing the SDK client instance. For example: +The default server can also be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example: ```java package hello.world; @@ -424,9 +382,9 @@ public class Application { This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------ | ------------ | ------------ | -| `authHeader` | apiKey | API key | +| Name | Type | Scheme | +| ------------ | ------ | ------- | +| `authHeader` | apiKey | API key | To authenticate with the API the `authHeader` parameter must be set when initializing the SDK client instance. For example: ```java diff --git a/bank-feeds/RELEASES.md b/bank-feeds/RELEASES.md index 9132d6b4..9d5d86f2 100644 --- a/bank-feeds/RELEASES.md +++ b/bank-feeds/RELEASES.md @@ -28,4 +28,14 @@ Based on: ### Generated - [java v1.0.0] bank-feeds ### Releases -- [Maven Central v1.0.0] https://central.sonatype.com/artifact/io.codat/bank-feeds/1.0.0 - bank-feeds \ No newline at end of file +- [Maven Central v1.0.0] https://central.sonatype.com/artifact/io.codat/bank-feeds/1.0.0 - bank-feeds + +## 2024-11-26 15:26:17 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.446.1 (2.462.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.0.0] bank-feeds +### Releases +- [Maven Central v2.0.0] https://central.sonatype.com/artifact/io.codat/bank-feeds/2.0.0 - bank-feeds \ No newline at end of file diff --git a/bank-feeds/build.gradle b/bank-feeds/build.gradle index 502cecba..a64a0478 100644 --- a/bank-feeds/build.gradle +++ b/bank-feeds/build.gradle @@ -63,7 +63,7 @@ tasks.withType(Javadoc) { } group = "io.codat" -version = "1.0.0" +version = "2.0.0" sourcesJar { archiveBaseName = "bank-feeds" @@ -101,7 +101,7 @@ publishing { maven(MavenPublication) { groupId = 'io.codat' artifactId = 'bank-feeds' - version = '1.0.0' + version = '2.0.0' from components.java @@ -145,10 +145,11 @@ if (!project.hasProperty('skip.signing')) { } dependencies { + api 'com.fasterxml.jackson.core:jackson-annotations:2.17.2' implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' - implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'} implementation 'org.apache.httpcomponents:httpclient:4.5.14' implementation 'org.apache.httpcomponents:httpmime:4.5.14' implementation 'commons-io:commons-io:2.15.1' diff --git a/bank-feeds/docs/models/components/BankTransactions.md b/bank-feeds/docs/models/components/BankTransactions.md index a1582e3e..41557780 100644 --- a/bank-feeds/docs/models/components/BankTransactions.md +++ b/bank-feeds/docs/models/components/BankTransactions.md @@ -5,12 +5,12 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount` | *BigDecimal* | :heavy_check_mark: | The amount transacted in the bank transaction. | 999.99 | +| `amount` | *Optional\* | :heavy_minus_sign: | The amount transacted in the bank transaction. | 999.99 | | `balance` | *Optional\* | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. | -999.99 | | `counterparty` | *JsonNullable\* | :heavy_minus_sign: | The giving or receiving party such as a person or organization. | ACME INC | -| `date` | *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 | +| `date` | *Optional\* | :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 | | `description` | *JsonNullable\* | :heavy_minus_sign: | Description of the bank transaction. | Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60 | -| `id` | *String* | :heavy_check_mark: | Identifier for the bank account transaction, unique for the company in the accounting software. | 716422529 | +| `id` | *Optional\* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting software. | 716422529 | | `reconciled` | *JsonNullable\* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. | false | | `reference` | *JsonNullable\* | :heavy_minus_sign: | An optional reference to the bank transaction. | reference for transaction | | `transactionType` | [JsonNullable\](../../models/components/BankTransactionType.md) | :heavy_minus_sign: | Type of transaction for the bank statement line. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/components/Company.md b/bank-feeds/docs/models/components/Company.md index 481462b1..6cc4f3c0 100644 --- a/bank-feeds/docs/models/components/Company.md +++ b/bank-feeds/docs/models/components/Company.md @@ -20,4 +20,6 @@ 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. | | `products` | List\<*String*> | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | | `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 | +| `referenceParentCompany` | [Optional\](../../models/components/CompanyReference.md) | :heavy_minus_sign: | N/A | | +| `referenceSubsidiaryCompanies` | List\<[CompanyReference](../../models/components/CompanyReference.md)> | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | | `tags` | Map\ | :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/bank-feeds/docs/models/components/CompanyAccessToken.md b/bank-feeds/docs/models/components/CompanyAccessToken.md new file mode 100644 index 00000000..660b5aab --- /dev/null +++ b/bank-feeds/docs/models/components/CompanyAccessToken.md @@ -0,0 +1,12 @@ +# CompanyAccessToken + +Details of the access token provisioned for a company. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `accessToken` | *String* | :heavy_check_mark: | The access token for the company. | | +| `expiresIn` | *long* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | +| `tokenType` | *String* | :heavy_check_mark: | The type of token. | Bearer | \ No newline at end of file diff --git a/bank-feeds/docs/models/components/Result.md b/bank-feeds/docs/models/components/Result.md new file mode 100644 index 00000000..802dabf6 --- /dev/null +++ b/bank-feeds/docs/models/components/Result.md @@ -0,0 +1,9 @@ +# Result + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `error` | *Optional\* | :heavy_minus_sign: | The error description for the attempted creation of the source account. | A bank account already exists with the same Id | +| `statusCode` | *Optional\* | :heavy_minus_sign: | The error status code for the attempted creation of the source account. | 409 | \ No newline at end of file diff --git a/bank-feeds/docs/models/components/SourceAccountBatchCreateResponse.md b/bank-feeds/docs/models/components/SourceAccountBatchCreateResponse.md new file mode 100644 index 00000000..37ff5efa --- /dev/null +++ b/bank-feeds/docs/models/components/SourceAccountBatchCreateResponse.md @@ -0,0 +1,11 @@ +# SourceAccountBatchCreateResponse + +The account ID and source account object of the successfully created source account. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `result` | [Optional\](../../models/components/SourceAccount.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | +| `sourceAccountId` | *Optional\* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | \ No newline at end of file diff --git a/bank-feeds/docs/models/components/SourceAccountBatchErrorResponse.md b/bank-feeds/docs/models/components/SourceAccountBatchErrorResponse.md new file mode 100644 index 00000000..09f77dcd --- /dev/null +++ b/bank-feeds/docs/models/components/SourceAccountBatchErrorResponse.md @@ -0,0 +1,11 @@ +# SourceAccountBatchErrorResponse + +Describes the error that occured when trying to create the specified source account. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `result` | [Optional\](../../models/components/Result.md) | :heavy_minus_sign: | N/A | | +| `sourceAccountId` | *Optional\* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | \ No newline at end of file diff --git a/bank-feeds/docs/models/components/SourceAccountV2BatchCreateResponse.md b/bank-feeds/docs/models/components/SourceAccountV2BatchCreateResponse.md new file mode 100644 index 00000000..81e16c0e --- /dev/null +++ b/bank-feeds/docs/models/components/SourceAccountV2BatchCreateResponse.md @@ -0,0 +1,11 @@ +# SourceAccountV2BatchCreateResponse + +The account ID and source account object of the successfully created source account. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `result` | [Optional\](../../models/components/SourceAccountV2.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | {
"id": "acc-001",
"accountName": "account-081",
"accountType": "checking",
"accountNumber": "12345670",
"routingInfo": {
"bankCode": 21001088,
"type": "bankcode"
},
"currency": "GBP",
"balance": 99.99,
"accountInfo": {
"description": "account description 1",
"nickname": "account 123",
"accountOpenDate": "2023-05-06T00:00:00Z",
"availableBalance": 10
},
"modifiedDate": "2024-08-02T00:00:00.000Z",
"status": "pending",
"feedStartDate": "2024-05-01T00:00:00Z"
} | +| `sourceAccountId` | *Optional\* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/CreateBatchSourceAccount1.md b/bank-feeds/docs/models/operations/CreateBatchSourceAccount1.md new file mode 100644 index 00000000..f7e44de4 --- /dev/null +++ b/bank-feeds/docs/models/operations/CreateBatchSourceAccount1.md @@ -0,0 +1,2 @@ +# CreateBatchSourceAccount1 + diff --git a/bank-feeds/docs/models/operations/CreateBatchSourceAccountRequest.md b/bank-feeds/docs/models/operations/CreateBatchSourceAccountRequest.md new file mode 100644 index 00000000..a236ab21 --- /dev/null +++ b/bank-feeds/docs/models/operations/CreateBatchSourceAccountRequest.md @@ -0,0 +1,10 @@ +# CreateBatchSourceAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `requestBody` | [Optional\](../../models/operations/CreateBatchSourceAccountRequestBody.md) | :heavy_minus_sign: | N/A | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/CreateBatchSourceAccountRequestBody.md b/bank-feeds/docs/models/operations/CreateBatchSourceAccountRequestBody.md new file mode 100644 index 00000000..f024f342 --- /dev/null +++ b/bank-feeds/docs/models/operations/CreateBatchSourceAccountRequestBody.md @@ -0,0 +1,2 @@ +# CreateBatchSourceAccountRequestBody + diff --git a/bank-feeds/docs/models/operations/CreateBatchSourceAccountResponse.md b/bank-feeds/docs/models/operations/CreateBatchSourceAccountResponse.md new file mode 100644 index 00000000..24f0d440 --- /dev/null +++ b/bank-feeds/docs/models/operations/CreateBatchSourceAccountResponse.md @@ -0,0 +1,12 @@ +# CreateBatchSourceAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `twoHundredApplicationJsonOneOf` | [Optional\](../../models/operations/CreateBatchSourceAccountResponseBody.md) | :heavy_minus_sign: | Success | +| `twoHundredAndSevenApplicationJsonOneOf` | [Optional\](../../models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.md) | :heavy_minus_sign: | Multi-Status | +| `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` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/CreateBatchSourceAccountResponseBody.md b/bank-feeds/docs/models/operations/CreateBatchSourceAccountResponseBody.md new file mode 100644 index 00000000..17319ff0 --- /dev/null +++ b/bank-feeds/docs/models/operations/CreateBatchSourceAccountResponseBody.md @@ -0,0 +1,4 @@ +# CreateBatchSourceAccountResponseBody + +Success + diff --git a/bank-feeds/docs/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.md b/bank-feeds/docs/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.md new file mode 100644 index 00000000..9475d0ec --- /dev/null +++ b/bank-feeds/docs/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.md @@ -0,0 +1,4 @@ +# CreateBatchSourceAccountSourceAccountsResponseBody + +Multi-Status + diff --git a/bank-feeds/docs/models/operations/GenerateCredentialsResponse.md b/bank-feeds/docs/models/operations/GenerateCredentialsResponse.md index a621fa4f..8aa5c3d5 100644 --- a/bank-feeds/docs/models/operations/GenerateCredentialsResponse.md +++ b/bank-feeds/docs/models/operations/GenerateCredentialsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `bankAccountCredentials` | [Optional\](../../models/components/BankAccountCredentials.md) | :heavy_minus_sign: | Success | -| `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` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `bankAccountCredentials` | [Optional\](../../models/components/BankAccountCredentials.md) | :heavy_minus_sign: | Success | {
"QuickBooks Online Bank Feeds": null,
"username": "S0MW-TR0P-7DS0",
"password": "cO0ajh0uGyTN0Pwh"
} | +| `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` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/GetCompanyAccessTokenRequest.md b/bank-feeds/docs/models/operations/GetCompanyAccessTokenRequest.md new file mode 100644 index 00000000..985dd3e0 --- /dev/null +++ b/bank-feeds/docs/models/operations/GetCompanyAccessTokenRequest.md @@ -0,0 +1,8 @@ +# GetCompanyAccessTokenRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/GetCompanyAccessTokenResponse.md b/bank-feeds/docs/models/operations/GetCompanyAccessTokenResponse.md new file mode 100644 index 00000000..9f04dbff --- /dev/null +++ b/bank-feeds/docs/models/operations/GetCompanyAccessTokenResponse.md @@ -0,0 +1,11 @@ +# GetCompanyAccessTokenResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `companyAccessToken` | [Optional\](../../models/components/CompanyAccessToken.md) | :heavy_minus_sign: | OK | {
"expiresIn": 86400,
"accessToken": "string",
"tokenType": "Bearer"
} | +| `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` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/GetCreateBankTransactionsModelRequest.md b/bank-feeds/docs/models/operations/GetCreateBankTransactionsModelRequest.md new file mode 100644 index 00000000..b868acfa --- /dev/null +++ b/bank-feeds/docs/models/operations/GetCreateBankTransactionsModelRequest.md @@ -0,0 +1,10 @@ +# GetCreateBankTransactionsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `accountId` | *String* | :heavy_check_mark: | Unique identifier for an account. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/GetCreateBankTransactionsModelResponse.md b/bank-feeds/docs/models/operations/GetCreateBankTransactionsModelResponse.md new file mode 100644 index 00000000..af054b3b --- /dev/null +++ b/bank-feeds/docs/models/operations/GetCreateBankTransactionsModelResponse.md @@ -0,0 +1,11 @@ +# GetCreateBankTransactionsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `pushOption` | [Optional\](../../models/components/PushOption.md) | :heavy_minus_sign: | Success | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/One.md b/bank-feeds/docs/models/operations/One.md new file mode 100644 index 00000000..73c34b83 --- /dev/null +++ b/bank-feeds/docs/models/operations/One.md @@ -0,0 +1,2 @@ +# One + diff --git a/bank-feeds/docs/sdks/accountmapping/README.md b/bank-feeds/docs/sdks/accountmapping/README.md index 0d64b004..c32916e4 100644 --- a/bank-feeds/docs/sdks/accountmapping/README.md +++ b/bank-feeds/docs/sdks/accountmapping/README.md @@ -22,6 +22,27 @@ To find valid target account options, first call the [List bank feed account map > > Only use this endpoint if you are building your own account management UI. +#### Account mapping variability + +The method of mapping the source account to the target account varies depending on the accounting software your company uses. + +#### Mapping options: + +1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. +2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. +3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + +### Integration-specific behaviour + +| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | +| --------------------- | ----------- | ---------------- | --------------------------- | +| Xero | ✅ | ✅ | | +| FreeAgent | ✅ | ✅ | | +| Oracle NetSuite | ✅ | ✅ | | +| Exact Online (NL) | ✅ | ✅ | | +| QuickBooks Online | | | ✅ | +| Sage | | | ✅ | + ### Example Usage ```java diff --git a/bank-feeds/docs/sdks/codatbankfeeds/README.md b/bank-feeds/docs/sdks/codatbankfeeds/README.md index 9c63c251..4a82c27d 100644 --- a/bank-feeds/docs/sdks/codatbankfeeds/README.md +++ b/bank-feeds/docs/sdks/codatbankfeeds/README.md @@ -20,4 +20,6 @@ A bank feed is a connection between a source bank account in your application an | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company's connections, and see previous operations. | - \ No newline at end of file + + +### Available Operations diff --git a/bank-feeds/docs/sdks/companies/README.md b/bank-feeds/docs/sdks/companies/README.md index f194a706..d1860b74 100644 --- a/bank-feeds/docs/sdks/companies/README.md +++ b/bank-feeds/docs/sdks/companies/README.md @@ -10,6 +10,7 @@ Create and manage your SMB users' companies. * [create](#create) - Create company * [delete](#delete) - Delete a company * [get](#get) - Get company +* [getAccessToken](#getaccesstoken) - Get company access token * [list](#list) - List companies * [update](#update) - Update company @@ -190,6 +191,62 @@ public class Application { | models/errors/ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | +## getAccessToken + +Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + +### Example Usage + +```java +package hello.world; + +import io.codat.bank_feeds.CodatBankFeeds; +import io.codat.bank_feeds.models.errors.ErrorMessage; +import io.codat.bank_feeds.models.operations.GetCompanyAccessTokenRequest; +import io.codat.bank_feeds.models.operations.GetCompanyAccessTokenResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws ErrorMessage, Exception { + + CodatBankFeeds sdk = CodatBankFeeds.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build(); + + GetCompanyAccessTokenRequest req = GetCompanyAccessTokenRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetCompanyAccessTokenResponse res = sdk.companies().getAccessToken() + .request(req) + .call(); + + if (res.companyAccessToken().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `request` | [GetCompanyAccessTokenRequest](../../models/operations/GetCompanyAccessTokenRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetCompanyAccessTokenResponse](../../models/operations/GetCompanyAccessTokenResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | + ## list The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. diff --git a/bank-feeds/docs/sdks/sourceaccounts/README.md b/bank-feeds/docs/sdks/sourceaccounts/README.md index b6a07bf4..6146a98a 100644 --- a/bank-feeds/docs/sdks/sourceaccounts/README.md +++ b/bank-feeds/docs/sdks/sourceaccounts/README.md @@ -7,7 +7,8 @@ Provide and manage lists of source bank accounts. ### Available Operations -* [create](#create) - Create source account +* [create](#create) - Create single source account +* [createBatch](#createbatch) - Create source accounts * [delete](#delete) - Delete source account * [deleteCredentials](#deletecredentials) - Delete all source account credentials * [generateCredentials](#generatecredentials) - Generate source account credentials @@ -18,27 +19,6 @@ Provide and manage lists of source bank accounts. The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. -#### Account mapping variability - -The method of mapping the source account to the target account varies depending on the accounting software your company uses. - -#### Mapping options: - -1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. -2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. -3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - -### Integration-specific behaviour - -| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | -| --------------------- | ----------- | ---------------- | --------------------------- | -| Xero | ✅ | ✅ | | -| FreeAgent | ✅ | ✅ | | -| Oracle NetSuite | ✅ | ✅ | | -| Exact Online (NL) | ✅ | ✅ | | -| QuickBooks Online | | | ✅ | -| Sage | | | ✅ | - > ### Versioning > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. @@ -123,6 +103,93 @@ public class Application { | models/errors/ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | +## createBatch + +The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + +> ### Versioning +> If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + +### Example Usage + +```java +package hello.world; + +import io.codat.bank_feeds.CodatBankFeeds; +import io.codat.bank_feeds.models.components.SourceAccount; +import io.codat.bank_feeds.models.components.Status; +import io.codat.bank_feeds.models.errors.ErrorMessage; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountRequest; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountRequestBody; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountResponse; +import java.lang.Exception; +import java.math.BigDecimal; +import java.util.List; + +public class Application { + + public static void main(String[] args) throws ErrorMessage, Exception { + + CodatBankFeeds sdk = CodatBankFeeds.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build(); + + CreateBatchSourceAccountRequest req = CreateBatchSourceAccountRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .requestBody(CreateBatchSourceAccountRequestBody.ofSourceAccount(List.of( + SourceAccount.builder() + .id("") + .accountName("account-081") + .accountNumber("12345670") + .accountType("Credit") + .balance(new BigDecimal("99.99")) + .currency("GBP") + .modifiedDate("2023-01-09T14:14:14.1057478Z") + .sortCode("123456") + .status(Status.PENDING) + .build(), + SourceAccount.builder() + .id("") + .accountName("account-095") + .accountNumber("12345671") + .accountType("Credit") + .balance(new BigDecimal("0")) + .currency("USD") + .modifiedDate("2023-01-09T14:14:14.1057478Z") + .sortCode("123456") + .status(Status.PENDING) + .build()))) + .build(); + + CreateBatchSourceAccountResponse res = sdk.sourceAccounts().createBatch() + .request(req) + .call(); + + if (res.twoHundredApplicationJsonOneOf().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `request` | [CreateBatchSourceAccountRequest](../../models/operations/CreateBatchSourceAccountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateBatchSourceAccountResponse](../../models/operations/CreateBatchSourceAccountResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| models/errors/ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | + ## delete The _Delete source account_ endpoint enables you to remove a source account. @@ -404,7 +471,6 @@ public class Application { .accountType("Credit") .balance(new BigDecimal("99.99")) .currency("GBP") - .feedStartDate("2022-10-23T00:00:00Z") .modifiedDate("2023-01-09T14:14:14.1057478Z") .sortCode("123456") .status(Status.PENDING) diff --git a/bank-feeds/docs/sdks/transactions/README.md b/bank-feeds/docs/sdks/transactions/README.md index 4f7ce0bc..53f3eb33 100644 --- a/bank-feeds/docs/sdks/transactions/README.md +++ b/bank-feeds/docs/sdks/transactions/README.md @@ -8,6 +8,7 @@ Create new bank account transactions for a company's connections, and see previo ### Available Operations * [create](#create) - Create bank transactions +* [getCreateModel](#getcreatemodel) - Get create bank transactions model * [getCreateOperation](#getcreateoperation) - Get create operation * [listCreateOperations](#listcreateoperations) - List create operations @@ -19,8 +20,8 @@ Create new bank account transactions for a company's connections, and see previo **Integration-specific behaviour** -Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - +The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. +Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. ### Example Usage @@ -54,11 +55,11 @@ public class Application { .transactions(List.of( BankTransactions.builder() .amount(new BigDecimal("999.99")) - .date("2022-10-23T00:00:00Z") - .id("716422529") .balance(new BigDecimal("-999.99")) .counterparty("ACME INC") + .date("2022-10-23T00:00:00Z") .description("Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60") + .id("716422529") .reconciled(false) .reference("reference for transaction") .build())) @@ -93,6 +94,69 @@ public class Application { | models/errors/ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | | models/errors/SDKError | 4XX, 5XX | \*/\* | +## getCreateModel + +The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + +[Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +### Example Usage + +```java +package hello.world; + +import io.codat.bank_feeds.CodatBankFeeds; +import io.codat.bank_feeds.models.errors.ErrorMessage; +import io.codat.bank_feeds.models.operations.GetCreateBankTransactionsModelRequest; +import io.codat.bank_feeds.models.operations.GetCreateBankTransactionsModelResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws ErrorMessage, Exception { + + CodatBankFeeds sdk = CodatBankFeeds.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build(); + + GetCreateBankTransactionsModelRequest req = GetCreateBankTransactionsModelRequest.builder() + .accountId("13d946f0-c5d5-42bc-b092-97ece17923ab") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateBankTransactionsModelResponse res = sdk.transactions().getCreateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request` | [GetCreateBankTransactionsModelRequest](../../models/operations/GetCreateBankTransactionsModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetCreateBankTransactionsModelResponse](../../models/operations/GetCreateBankTransactionsModelResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models/errors/ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| models/errors/SDKError | 4XX, 5XX | \*/\* | + ## getCreateOperation The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/AccountMapping.java b/bank-feeds/src/main/java/io/codat/bank_feeds/AccountMapping.java index bd68ba52..99d4862b 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/AccountMapping.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/AccountMapping.java @@ -66,6 +66,27 @@ public class AccountMapping implements * > **For custom builds only** * > * > Only use this endpoint if you are building your own account management UI. + * + * #### Account mapping variability + * + * The method of mapping the source account to the target account varies depending on the accounting software your company uses. + * + * #### Mapping options: + * + * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. + * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. + * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + * + * ### Integration-specific behaviour + * + * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | + * | --------------------- | ----------- | ---------------- | --------------------------- | + * | Xero | ✅ | ✅ | | + * | FreeAgent | ✅ | ✅ | | + * | Oracle NetSuite | ✅ | ✅ | | + * | Exact Online (NL) | ✅ | ✅ | | + * | QuickBooks Online | | | ✅ | + * | Sage | | | ✅ | * @return The call builder */ public CreateBankAccountMappingRequestBuilder create() { @@ -83,6 +104,27 @@ public CreateBankAccountMappingRequestBuilder create() { * > **For custom builds only** * > * > Only use this endpoint if you are building your own account management UI. + * + * #### Account mapping variability + * + * The method of mapping the source account to the target account varies depending on the accounting software your company uses. + * + * #### Mapping options: + * + * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. + * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. + * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + * + * ### Integration-specific behaviour + * + * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | + * | --------------------- | ----------- | ---------------- | --------------------------- | + * | Xero | ✅ | ✅ | | + * | FreeAgent | ✅ | ✅ | | + * | Oracle NetSuite | ✅ | ✅ | | + * | Exact Online (NL) | ✅ | ✅ | | + * | QuickBooks Online | | | ✅ | + * | Sage | | | ✅ | * @param request The request object containing all of the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails @@ -103,6 +145,27 @@ public CreateBankAccountMappingResponse create( * > **For custom builds only** * > * > Only use this endpoint if you are building your own account management UI. + * + * #### Account mapping variability + * + * The method of mapping the source account to the target account varies depending on the accounting software your company uses. + * + * #### Mapping options: + * + * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. + * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. + * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + * + * ### Integration-specific behaviour + * + * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | + * | --------------------- | ----------- | ---------------- | --------------------------- | + * | Xero | ✅ | ✅ | | + * | FreeAgent | ✅ | ✅ | | + * | Oracle NetSuite | ✅ | ✅ | | + * | Exact Online (NL) | ✅ | ✅ | | + * | QuickBooks Online | | | ✅ | + * | Sage | | | ✅ | * @param request The request object containing all of the parameters for the API call. * @param options additional options * @return The response from the API call diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/Companies.java b/bank-feeds/src/main/java/io/codat/bank_feeds/Companies.java index cf341ae0..5e0246c4 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/Companies.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/Companies.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.codat.bank_feeds.models.components.Company; +import io.codat.bank_feeds.models.components.CompanyAccessToken; import io.codat.bank_feeds.models.components.CompanyRequestBody; import io.codat.bank_feeds.models.errors.ErrorMessage; import io.codat.bank_feeds.models.errors.SDKError; @@ -14,6 +15,9 @@ import io.codat.bank_feeds.models.operations.DeleteCompanyRequest; import io.codat.bank_feeds.models.operations.DeleteCompanyRequestBuilder; import io.codat.bank_feeds.models.operations.DeleteCompanyResponse; +import io.codat.bank_feeds.models.operations.GetCompanyAccessTokenRequest; +import io.codat.bank_feeds.models.operations.GetCompanyAccessTokenRequestBuilder; +import io.codat.bank_feeds.models.operations.GetCompanyAccessTokenResponse; import io.codat.bank_feeds.models.operations.GetCompanyRequest; import io.codat.bank_feeds.models.operations.GetCompanyRequestBuilder; import io.codat.bank_feeds.models.operations.GetCompanyResponse; @@ -56,6 +60,7 @@ public class Companies implements MethodCallCreateCompany, MethodCallDeleteCompany, MethodCallGetCompany, + MethodCallGetCompanyAccessToken, MethodCallListCompanies, MethodCallUpdateCompany { @@ -607,6 +612,178 @@ public GetCompanyResponse get( + /** + * Get company access token + * Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + * + * @return The call builder + */ + public GetCompanyAccessTokenRequestBuilder getAccessToken() { + return new GetCompanyAccessTokenRequestBuilder(this); + } + + /** + * Get company access token + * Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + * + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetCompanyAccessTokenResponse getAccessToken( + GetCompanyAccessTokenRequest request) throws Exception { + return getAccessToken(request, Optional.empty()); + } + + /** + * Get company access token + * Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + * + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetCompanyAccessTokenResponse getAccessToken( + GetCompanyAccessTokenRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + GetCompanyAccessTokenRequest.class, + _baseUrl, + "/companies/{companyId}/accessToken", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); + } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("408"); + _statusCodes.add("429"); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-company-access-token", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-company-access-token", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-company-access-token", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetCompanyAccessTokenResponse.Builder _resBuilder = + GetCompanyAccessTokenResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + GetCompanyAccessTokenResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + CompanyAccessToken _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withCompanyAccessToken(Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "402", "403", "404", "429", "500", "503")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + ErrorMessage _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(_httpRes)); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.extractByteArrayFromBody(_httpRes)); + } + + + /** * List companies * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/SDKConfiguration.java b/bank-feeds/src/main/java/io/codat/bank_feeds/SDKConfiguration.java index b29d3753..d7b07867 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/SDKConfiguration.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/SDKConfiguration.java @@ -23,8 +23,8 @@ public Optional securitySource() { public int serverIdx = 0; private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "3.0.0"; - public static final String SDK_VERSION = "1.0.0"; - public static final String GEN_VERSION = "2.451.0"; + public static final String SDK_VERSION = "2.0.0"; + public static final String GEN_VERSION = "2.462.1"; private static final String BASE_PACKAGE = "io.codat.bank_feeds"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/SourceAccounts.java b/bank-feeds/src/main/java/io/codat/bank_feeds/SourceAccounts.java index f7c2d736..227a3918 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/SourceAccounts.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/SourceAccounts.java @@ -9,6 +9,11 @@ import io.codat.bank_feeds.models.components.SourceAccount; import io.codat.bank_feeds.models.errors.ErrorMessage; import io.codat.bank_feeds.models.errors.SDKError; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountRequest; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountRequestBuilder; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountResponse; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountResponseBody; +import io.codat.bank_feeds.models.operations.CreateBatchSourceAccountSourceAccountsResponseBody; import io.codat.bank_feeds.models.operations.CreateSourceAccountRequest; import io.codat.bank_feeds.models.operations.CreateSourceAccountRequestBuilder; import io.codat.bank_feeds.models.operations.CreateSourceAccountResponse; @@ -60,6 +65,7 @@ */ public class SourceAccounts implements MethodCallCreateSourceAccount, + MethodCallCreateBatchSourceAccount, MethodCallDeleteSourceAccount, MethodCallDeleteBankFeedCredentials, MethodCallGenerateCredentials, @@ -74,30 +80,9 @@ public class SourceAccounts implements /** - * Create source account + * Create single source account * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. * - * #### Account mapping variability - * - * The method of mapping the source account to the target account varies depending on the accounting software your company uses. - * - * #### Mapping options: - * - * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - * - * ### Integration-specific behaviour - * - * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - * | --------------------- | ----------- | ---------------- | --------------------------- | - * | Xero | ✅ | ✅ | | - * | FreeAgent | ✅ | ✅ | | - * | Oracle NetSuite | ✅ | ✅ | | - * | Exact Online (NL) | ✅ | ✅ | | - * | QuickBooks Online | | | ✅ | - * | Sage | | | ✅ | - * * > ### Versioning * > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. * @return The call builder @@ -107,30 +92,9 @@ public CreateSourceAccountRequestBuilder create() { } /** - * Create source account + * Create single source account * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. * - * #### Account mapping variability - * - * The method of mapping the source account to the target account varies depending on the accounting software your company uses. - * - * #### Mapping options: - * - * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - * - * ### Integration-specific behaviour - * - * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - * | --------------------- | ----------- | ---------------- | --------------------------- | - * | Xero | ✅ | ✅ | | - * | FreeAgent | ✅ | ✅ | | - * | Oracle NetSuite | ✅ | ✅ | | - * | Exact Online (NL) | ✅ | ✅ | | - * | QuickBooks Online | | | ✅ | - * | Sage | | | ✅ | - * * > ### Versioning * > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. * @param request The request object containing all of the parameters for the API call. @@ -143,30 +107,9 @@ public CreateSourceAccountResponse create( } /** - * Create source account + * Create single source account * The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. * - * #### Account mapping variability - * - * The method of mapping the source account to the target account varies depending on the accounting software your company uses. - * - * #### Mapping options: - * - * 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - * 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - * 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - * - * ### Integration-specific behaviour - * - * | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - * | --------------------- | ----------- | ---------------- | --------------------------- | - * | Xero | ✅ | ✅ | | - * | FreeAgent | ✅ | ✅ | | - * | Oracle NetSuite | ✅ | ✅ | | - * | Exact Online (NL) | ✅ | ✅ | | - * | QuickBooks Online | | | ✅ | - * | Sage | | | ✅ | - * * > ### Versioning * > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. * @param request The request object containing all of the parameters for the API call. @@ -324,6 +267,209 @@ public CreateSourceAccountResponse create( + /** + * Create source accounts + * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + * + * > ### Versioning + * > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * @return The call builder + */ + public CreateBatchSourceAccountRequestBuilder createBatch() { + return new CreateBatchSourceAccountRequestBuilder(this); + } + + /** + * Create source accounts + * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + * + * > ### Versioning + * > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public CreateBatchSourceAccountResponse createBatch( + CreateBatchSourceAccountRequest request) throws Exception { + return createBatch(request, Optional.empty()); + } + + /** + * Create source accounts + * The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + * + * > ### Versioning + * > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public CreateBatchSourceAccountResponse createBatch( + CreateBatchSourceAccountRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + CreateBatchSourceAccountRequest.class, + _baseUrl, + "/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/batch", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "POST"); + Object _convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody _serializedRequestBody = Utils.serializeRequestBody( + _convertedRequest, + "requestBody", + "json", + false); + _req.setBody(Optional.ofNullable(_serializedRequestBody)); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); + } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("408"); + _statusCodes.add("429"); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "create-batch-source-account", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "create-batch-source-account", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "create-batch-source-account", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateBatchSourceAccountResponse.Builder _resBuilder = + CreateBatchSourceAccountResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + CreateBatchSourceAccountResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + CreateBatchSourceAccountResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTwoHundredApplicationJsonOneOf(Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "207")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + CreateBatchSourceAccountSourceAccountsResponseBody _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withTwoHundredAndSevenApplicationJsonOneOf(Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "402", "403", "404", "409", "429", "500", "503")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + ErrorMessage _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(_httpRes)); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.extractByteArrayFromBody(_httpRes)); + } + + + /** * Delete source account * The _Delete source account_ endpoint enables you to remove a source account. diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/Transactions.java b/bank-feeds/src/main/java/io/codat/bank_feeds/Transactions.java index ba191e0b..a3c5edf9 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/Transactions.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/Transactions.java @@ -7,11 +7,15 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.codat.bank_feeds.models.components.PushOperation; import io.codat.bank_feeds.models.components.PushOperations; +import io.codat.bank_feeds.models.components.PushOption; import io.codat.bank_feeds.models.errors.ErrorMessage; import io.codat.bank_feeds.models.errors.SDKError; import io.codat.bank_feeds.models.operations.CreateBankTransactionsRequest; import io.codat.bank_feeds.models.operations.CreateBankTransactionsRequestBuilder; import io.codat.bank_feeds.models.operations.CreateBankTransactionsResponse; +import io.codat.bank_feeds.models.operations.GetCreateBankTransactionsModelRequest; +import io.codat.bank_feeds.models.operations.GetCreateBankTransactionsModelRequestBuilder; +import io.codat.bank_feeds.models.operations.GetCreateBankTransactionsModelResponse; import io.codat.bank_feeds.models.operations.GetCreateOperationRequest; import io.codat.bank_feeds.models.operations.GetCreateOperationRequestBuilder; import io.codat.bank_feeds.models.operations.GetCreateOperationResponse; @@ -49,6 +53,7 @@ */ public class Transactions implements MethodCallCreateBankTransactions, + MethodCallGetCreateBankTransactionsModel, MethodCallGetCreateOperation, MethodCallListCreateOperations { @@ -67,8 +72,8 @@ public class Transactions implements * * **Integration-specific behaviour** * - * Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - * + * The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. + * Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. * @return The call builder */ public CreateBankTransactionsRequestBuilder create() { @@ -83,8 +88,8 @@ public CreateBankTransactionsRequestBuilder create() { * * **Integration-specific behaviour** * - * Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - * + * The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. + * Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. * @param request The request object containing all of the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails @@ -102,8 +107,8 @@ public CreateBankTransactionsResponse create( * * **Integration-specific behaviour** * - * Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - * + * The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. + * Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. * @param request The request object containing all of the parameters for the API call. * @param options additional options * @return The response from the API call @@ -264,6 +269,193 @@ public CreateBankTransactionsResponse create( + /** + * Get create bank transactions model + * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + * + * [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * @return The call builder + */ + public GetCreateBankTransactionsModelRequestBuilder getCreateModel() { + return new GetCreateBankTransactionsModelRequestBuilder(this); + } + + /** + * Get create bank transactions model + * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + * + * [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * @param request The request object containing all of the parameters for the API call. + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetCreateBankTransactionsModelResponse getCreateModel( + GetCreateBankTransactionsModelRequest request) throws Exception { + return getCreateModel(request, Optional.empty()); + } + + /** + * Get create bank transactions model + * The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + * + * [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * @param request The request object containing all of the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws Exception if the API call fails + */ + public GetCreateBankTransactionsModelResponse getCreateModel( + GetCreateBankTransactionsModelRequest request, + Optional options) throws Exception { + + if (options.isPresent()) { + options.get().validate(Arrays.asList(Options.Option.RETRY_CONFIG)); + } + String _baseUrl = this.sdkConfiguration.serverUrl; + String _url = Utils.generateURL( + GetCreateBankTransactionsModelRequest.class, + _baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", + request, null); + + HTTPRequest _req = new HTTPRequest(_url, "GET"); + _req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Utils.configureSecurity(_req, + this.sdkConfiguration.securitySource.getSecurity()); + + HTTPClient _client = this.sdkConfiguration.defaultClient; + HTTPRequest _finalReq = _req; + RetryConfig _retryConfig; + if (options.isPresent() && options.get().retryConfig().isPresent()) { + _retryConfig = options.get().retryConfig().get(); + } else if (this.sdkConfiguration.retryConfig.isPresent()) { + _retryConfig = this.sdkConfiguration.retryConfig.get(); + } else { + _retryConfig = RetryConfig.builder() + .backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double)(1.5)) + .maxElapsedTime(3600000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build(); + } + List _statusCodes = new ArrayList<>(); + _statusCodes.add("408"); + _statusCodes.add("429"); + _statusCodes.add("5XX"); + Retries _retries = Retries.builder() + .action(() -> { + HttpRequest _r = null; + try { + _r = sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + "get-create-bank-transactions-model", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _finalReq.build()); + } catch (Exception _e) { + throw new NonRetryableException(_e); + } + try { + return _client.send(_r); + } catch (Exception _e) { + return sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + "get-create-bank-transactions-model", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + Optional.empty(), + Optional.of(_e)); + } + }) + .retryConfig(_retryConfig) + .statusCodes(_statusCodes) + .build(); + HttpResponse _httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + "get-create-bank-transactions-model", + Optional.of(List.of()), + sdkConfiguration.securitySource()), + _retries.run()); + String _contentType = _httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetCreateBankTransactionsModelResponse.Builder _resBuilder = + GetCreateBankTransactionsModelResponse + .builder() + .contentType(_contentType) + .statusCode(_httpRes.statusCode()) + .rawResponse(_httpRes); + + GetCreateBankTransactionsModelResponse _res = _resBuilder.build(); + + if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + PushOption _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + _res.withPushOption(Optional.ofNullable(_out)); + return _res; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "402", "403", "404", "429", "500", "503")) { + if (Utils.contentTypeMatches(_contentType, "application/json")) { + ErrorMessage _out = Utils.mapper().readValue( + Utils.toUtf8AndClose(_httpRes.body()), + new TypeReference() {}); + throw _out; + } else { + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected content-type received: " + _contentType, + Utils.extractByteArrayFromBody(_httpRes)); + } + } + if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX", "5XX")) { + // no content + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(_httpRes)); + } + throw new SDKError( + _httpRes, + _httpRes.statusCode(), + "Unexpected status code received: " + _httpRes.statusCode(), + Utils.extractByteArrayFromBody(_httpRes)); + } + + + /** * Get create operation * The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/BankTransactions.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/BankTransactions.java index 33fcd9ba..a920cb1b 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/BankTransactions.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/BankTransactions.java @@ -26,8 +26,9 @@ public class BankTransactions { /** * The amount transacted in the bank transaction. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("amount") - private BigDecimal amount; + private Optional amount; /** * The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. @@ -64,8 +65,9 @@ public class BankTransactions { * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("date") - private String date; + private Optional date; /** * Description of the bank transaction. @@ -77,8 +79,9 @@ public class BankTransactions { /** * Identifier for the bank account transaction, unique for the company in the accounting software. */ + @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private String id; + private Optional id; /** * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. @@ -103,12 +106,12 @@ public class BankTransactions { @JsonCreator public BankTransactions( - @JsonProperty("amount") BigDecimal amount, + @JsonProperty("amount") Optional amount, @JsonProperty("balance") Optional balance, @JsonProperty("counterparty") JsonNullable counterparty, - @JsonProperty("date") String date, + @JsonProperty("date") Optional date, @JsonProperty("description") JsonNullable description, - @JsonProperty("id") String id, + @JsonProperty("id") Optional id, @JsonProperty("reconciled") JsonNullable reconciled, @JsonProperty("reference") JsonNullable reference, @JsonProperty("transactionType") JsonNullable transactionType) { @@ -132,19 +135,17 @@ public BankTransactions( this.transactionType = transactionType; } - public BankTransactions( - BigDecimal amount, - String date, - String id) { - this(amount, Optional.empty(), JsonNullable.undefined(), date, JsonNullable.undefined(), id, JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + public BankTransactions() { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); } /** * The amount transacted in the bank transaction. */ + @SuppressWarnings("unchecked") @JsonIgnore - public BigDecimal amount() { - return amount; + public Optional amount() { + return (Optional) amount; } /** @@ -186,7 +187,7 @@ public JsonNullable counterparty() { * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ @JsonIgnore - public String date() { + public Optional date() { return date; } @@ -202,7 +203,7 @@ public JsonNullable description() { * Identifier for the bank account transaction, unique for the company in the accounting software. */ @JsonIgnore - public String id() { + public Optional id() { return id; } @@ -235,18 +236,27 @@ public final static Builder builder() { return new Builder(); } + /** + * The amount transacted in the bank transaction. + */ + public BankTransactions withAmount(BigDecimal amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + /** * The amount transacted in the bank transaction. */ public BankTransactions withAmount(double amount) { - this.amount = BigDecimal.valueOf(amount); + this.amount = Optional.of(BigDecimal.valueOf(amount)); return this; } /** * The amount transacted in the bank transaction. */ - public BankTransactions withAmount(BigDecimal amount) { + public BankTransactions withAmount(Optional amount) { Utils.checkNotNull(amount, "amount"); this.amount = amount; return this; @@ -318,6 +328,33 @@ public BankTransactions withCounterparty(JsonNullable counterparty) { * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ public BankTransactions withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = Optional.ofNullable(date); + return this; + } + + /** + * 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. + */ + public BankTransactions withDate(Optional date) { Utils.checkNotNull(date, "date"); this.date = date; return this; @@ -345,6 +382,15 @@ public BankTransactions withDescription(JsonNullable description) { * Identifier for the bank account transaction, unique for the company in the accounting software. */ public BankTransactions withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + */ + public BankTransactions withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; @@ -455,17 +501,17 @@ public String toString() { public final static class Builder { - private BigDecimal amount; + private Optional amount = Optional.empty(); private Optional balance = Optional.empty(); private JsonNullable counterparty = JsonNullable.undefined(); - private String date; + private Optional date = Optional.empty(); private JsonNullable description = JsonNullable.undefined(); - private String id; + private Optional id = Optional.empty(); private JsonNullable reconciled = JsonNullable.undefined(); @@ -477,18 +523,27 @@ private Builder() { // force use of static builder() method } + /** + * The amount transacted in the bank transaction. + */ + public Builder amount(BigDecimal amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + /** * The amount transacted in the bank transaction. */ public Builder amount(double amount) { - this.amount = BigDecimal.valueOf(amount); + this.amount = Optional.of(BigDecimal.valueOf(amount)); return this; } /** * The amount transacted in the bank transaction. */ - public Builder amount(BigDecimal amount) { + public Builder amount(Optional amount) { Utils.checkNotNull(amount, "amount"); this.amount = amount; return this; @@ -560,6 +615,33 @@ public Builder counterparty(JsonNullable counterparty) { * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ public Builder date(String date) { + Utils.checkNotNull(date, "date"); + this.date = Optional.ofNullable(date); + return this; + } + + /** + * 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. + */ + public Builder date(Optional date) { Utils.checkNotNull(date, "date"); this.date = date; return this; @@ -587,6 +669,15 @@ public Builder description(JsonNullable description) { * Identifier for the bank account transaction, unique for the company in the accounting software. */ public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bank account transaction, unique for the company in the accounting software. + */ + public Builder id(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Company.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Company.java index 83a863e1..25680010 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Company.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Company.java @@ -123,6 +123,17 @@ public class Company { @JsonProperty("redirect") private String redirect; + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("referenceParentCompany") + private Optional referenceParentCompany; + + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("referenceSubsidiaryCompanies") + private Optional> referenceSubsidiaryCompanies; + /** * A collection of user-defined key-value pairs that store custom metadata against the company. */ @@ -141,6 +152,8 @@ public Company( @JsonProperty("name") String name, @JsonProperty("products") Optional> products, @JsonProperty("redirect") String redirect, + @JsonProperty("referenceParentCompany") Optional referenceParentCompany, + @JsonProperty("referenceSubsidiaryCompanies") Optional> referenceSubsidiaryCompanies, @JsonProperty("tags") Optional> tags) { Utils.checkNotNull(created, "created"); Utils.checkNotNull(createdByUserName, "createdByUserName"); @@ -151,6 +164,8 @@ public Company( Utils.checkNotNull(name, "name"); Utils.checkNotNull(products, "products"); Utils.checkNotNull(redirect, "redirect"); + Utils.checkNotNull(referenceParentCompany, "referenceParentCompany"); + Utils.checkNotNull(referenceSubsidiaryCompanies, "referenceSubsidiaryCompanies"); Utils.checkNotNull(tags, "tags"); this.created = created; this.createdByUserName = createdByUserName; @@ -161,6 +176,8 @@ public Company( this.name = name; this.products = products; this.redirect = redirect; + this.referenceParentCompany = referenceParentCompany; + this.referenceSubsidiaryCompanies = referenceSubsidiaryCompanies; this.tags = tags; } @@ -168,7 +185,7 @@ public Company( String id, String name, String redirect) { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), id, Optional.empty(), name, Optional.empty(), redirect, Optional.empty()); + this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), id, Optional.empty(), name, Optional.empty(), redirect, Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -278,6 +295,21 @@ public String redirect() { return redirect; } + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional referenceParentCompany() { + return (Optional) referenceParentCompany; + } + + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> referenceSubsidiaryCompanies() { + return (Optional>) referenceSubsidiaryCompanies; + } + /** * A collection of user-defined key-value pairs that store custom metadata against the company. */ @@ -492,6 +524,36 @@ public Company withRedirect(String redirect) { return this; } + public Company withReferenceParentCompany(CompanyReference referenceParentCompany) { + Utils.checkNotNull(referenceParentCompany, "referenceParentCompany"); + this.referenceParentCompany = Optional.ofNullable(referenceParentCompany); + return this; + } + + public Company withReferenceParentCompany(Optional referenceParentCompany) { + Utils.checkNotNull(referenceParentCompany, "referenceParentCompany"); + this.referenceParentCompany = referenceParentCompany; + return this; + } + + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + */ + public Company withReferenceSubsidiaryCompanies(List referenceSubsidiaryCompanies) { + Utils.checkNotNull(referenceSubsidiaryCompanies, "referenceSubsidiaryCompanies"); + this.referenceSubsidiaryCompanies = Optional.ofNullable(referenceSubsidiaryCompanies); + return this; + } + + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + */ + public Company withReferenceSubsidiaryCompanies(Optional> referenceSubsidiaryCompanies) { + Utils.checkNotNull(referenceSubsidiaryCompanies, "referenceSubsidiaryCompanies"); + this.referenceSubsidiaryCompanies = referenceSubsidiaryCompanies; + return this; + } + /** * A collection of user-defined key-value pairs that store custom metadata against the company. */ @@ -529,6 +591,8 @@ public boolean equals(java.lang.Object o) { Objects.deepEquals(this.name, other.name) && Objects.deepEquals(this.products, other.products) && Objects.deepEquals(this.redirect, other.redirect) && + Objects.deepEquals(this.referenceParentCompany, other.referenceParentCompany) && + Objects.deepEquals(this.referenceSubsidiaryCompanies, other.referenceSubsidiaryCompanies) && Objects.deepEquals(this.tags, other.tags); } @@ -544,6 +608,8 @@ public int hashCode() { name, products, redirect, + referenceParentCompany, + referenceSubsidiaryCompanies, tags); } @@ -559,6 +625,8 @@ public String toString() { "name", name, "products", products, "redirect", redirect, + "referenceParentCompany", referenceParentCompany, + "referenceSubsidiaryCompanies", referenceSubsidiaryCompanies, "tags", tags); } @@ -582,6 +650,10 @@ public final static class Builder { private String redirect; + private Optional referenceParentCompany = Optional.empty(); + + private Optional> referenceSubsidiaryCompanies = Optional.empty(); + private Optional> tags = Optional.empty(); private Builder() { @@ -789,6 +861,36 @@ public Builder redirect(String redirect) { return this; } + public Builder referenceParentCompany(CompanyReference referenceParentCompany) { + Utils.checkNotNull(referenceParentCompany, "referenceParentCompany"); + this.referenceParentCompany = Optional.ofNullable(referenceParentCompany); + return this; + } + + public Builder referenceParentCompany(Optional referenceParentCompany) { + Utils.checkNotNull(referenceParentCompany, "referenceParentCompany"); + this.referenceParentCompany = referenceParentCompany; + return this; + } + + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + */ + public Builder referenceSubsidiaryCompanies(List referenceSubsidiaryCompanies) { + Utils.checkNotNull(referenceSubsidiaryCompanies, "referenceSubsidiaryCompanies"); + this.referenceSubsidiaryCompanies = Optional.ofNullable(referenceSubsidiaryCompanies); + return this; + } + + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + */ + public Builder referenceSubsidiaryCompanies(Optional> referenceSubsidiaryCompanies) { + Utils.checkNotNull(referenceSubsidiaryCompanies, "referenceSubsidiaryCompanies"); + this.referenceSubsidiaryCompanies = referenceSubsidiaryCompanies; + return this; + } + /** * A collection of user-defined key-value pairs that store custom metadata against the company. */ @@ -818,6 +920,8 @@ public Company build() { name, products, redirect, + referenceParentCompany, + referenceSubsidiaryCompanies, tags); } } diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/CompanyAccessToken.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/CompanyAccessToken.java new file mode 100644 index 00000000..578870ca --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/CompanyAccessToken.java @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.components; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + +/** + * CompanyAccessToken - Details of the access token provisioned for a company. + */ + +public class CompanyAccessToken { + + /** + * The access token for the company. + */ + @JsonProperty("accessToken") + private String accessToken; + + /** + * The number of seconds until the access token expires. + */ + @JsonProperty("expiresIn") + private long expiresIn; + + /** + * The type of token. + */ + @JsonProperty("tokenType") + private String tokenType; + + @JsonCreator + public CompanyAccessToken( + @JsonProperty("accessToken") String accessToken, + @JsonProperty("expiresIn") long expiresIn, + @JsonProperty("tokenType") String tokenType) { + Utils.checkNotNull(accessToken, "accessToken"); + Utils.checkNotNull(expiresIn, "expiresIn"); + Utils.checkNotNull(tokenType, "tokenType"); + this.accessToken = accessToken; + this.expiresIn = expiresIn; + this.tokenType = tokenType; + } + + /** + * The access token for the company. + */ + @JsonIgnore + public String accessToken() { + return accessToken; + } + + /** + * The number of seconds until the access token expires. + */ + @JsonIgnore + public long expiresIn() { + return expiresIn; + } + + /** + * The type of token. + */ + @JsonIgnore + public String tokenType() { + return tokenType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The access token for the company. + */ + public CompanyAccessToken withAccessToken(String accessToken) { + Utils.checkNotNull(accessToken, "accessToken"); + this.accessToken = accessToken; + return this; + } + + /** + * The number of seconds until the access token expires. + */ + public CompanyAccessToken withExpiresIn(long expiresIn) { + Utils.checkNotNull(expiresIn, "expiresIn"); + this.expiresIn = expiresIn; + return this; + } + + /** + * The type of token. + */ + public CompanyAccessToken withTokenType(String tokenType) { + Utils.checkNotNull(tokenType, "tokenType"); + this.tokenType = tokenType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompanyAccessToken other = (CompanyAccessToken) o; + return + Objects.deepEquals(this.accessToken, other.accessToken) && + Objects.deepEquals(this.expiresIn, other.expiresIn) && + Objects.deepEquals(this.tokenType, other.tokenType); + } + + @Override + public int hashCode() { + return Objects.hash( + accessToken, + expiresIn, + tokenType); + } + + @Override + public String toString() { + return Utils.toString(CompanyAccessToken.class, + "accessToken", accessToken, + "expiresIn", expiresIn, + "tokenType", tokenType); + } + + public final static class Builder { + + private String accessToken; + + private Long expiresIn; + + private String tokenType; + + private Builder() { + // force use of static builder() method + } + + /** + * The access token for the company. + */ + public Builder accessToken(String accessToken) { + Utils.checkNotNull(accessToken, "accessToken"); + this.accessToken = accessToken; + return this; + } + + /** + * The number of seconds until the access token expires. + */ + public Builder expiresIn(long expiresIn) { + Utils.checkNotNull(expiresIn, "expiresIn"); + this.expiresIn = expiresIn; + return this; + } + + /** + * The type of token. + */ + public Builder tokenType(String tokenType) { + Utils.checkNotNull(tokenType, "tokenType"); + this.tokenType = tokenType; + return this; + } + + public CompanyAccessToken build() { + return new CompanyAccessToken( + accessToken, + expiresIn, + tokenType); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Result.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Result.java new file mode 100644 index 00000000..47c9cb36 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/Result.java @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.components; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + + +public class Result { + + /** + * The error description for the attempted creation of the source account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("error") + private Optional error; + + /** + * The error status code for the attempted creation of the source account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusCode") + private Optional statusCode; + + @JsonCreator + public Result( + @JsonProperty("error") Optional error, + @JsonProperty("statusCode") Optional statusCode) { + Utils.checkNotNull(error, "error"); + Utils.checkNotNull(statusCode, "statusCode"); + this.error = error; + this.statusCode = statusCode; + } + + public Result() { + this(Optional.empty(), Optional.empty()); + } + + /** + * The error description for the attempted creation of the source account. + */ + @JsonIgnore + public Optional error() { + return error; + } + + /** + * The error status code for the attempted creation of the source account. + */ + @JsonIgnore + public Optional statusCode() { + return statusCode; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The error description for the attempted creation of the source account. + */ + public Result withError(String error) { + Utils.checkNotNull(error, "error"); + this.error = Optional.ofNullable(error); + return this; + } + + /** + * The error description for the attempted creation of the source account. + */ + public Result withError(Optional error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + /** + * The error status code for the attempted creation of the source account. + */ + public Result withStatusCode(String statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + /** + * The error status code for the attempted creation of the source account. + */ + public Result withStatusCode(Optional statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Result other = (Result) o; + return + Objects.deepEquals(this.error, other.error) && + Objects.deepEquals(this.statusCode, other.statusCode); + } + + @Override + public int hashCode() { + return Objects.hash( + error, + statusCode); + } + + @Override + public String toString() { + return Utils.toString(Result.class, + "error", error, + "statusCode", statusCode); + } + + public final static class Builder { + + private Optional error = Optional.empty(); + + private Optional statusCode = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The error description for the attempted creation of the source account. + */ + public Builder error(String error) { + Utils.checkNotNull(error, "error"); + this.error = Optional.ofNullable(error); + return this; + } + + /** + * The error description for the attempted creation of the source account. + */ + public Builder error(Optional error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + /** + * The error status code for the attempted creation of the source account. + */ + public Builder statusCode(String statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + /** + * The error status code for the attempted creation of the source account. + */ + public Builder statusCode(Optional statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + public Result build() { + return new Result( + error, + statusCode); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchCreateResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchCreateResponse.java new file mode 100644 index 00000000..451e8018 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchCreateResponse.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.components; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Objects; +import java.util.Optional; + +/** + * SourceAccountBatchCreateResponse - The account ID and source account object of the successfully created source account. + */ + +public class SourceAccountBatchCreateResponse { + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("result") + private Optional result; + + /** + * Unique ID for the source account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceAccountId") + private Optional sourceAccountId; + + @JsonCreator + public SourceAccountBatchCreateResponse( + @JsonProperty("result") Optional result, + @JsonProperty("sourceAccountId") Optional sourceAccountId) { + Utils.checkNotNull(result, "result"); + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.result = result; + this.sourceAccountId = sourceAccountId; + } + + public SourceAccountBatchCreateResponse() { + this(Optional.empty(), Optional.empty()); + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional result() { + return (Optional) result; + } + + /** + * Unique ID for the source account. + */ + @JsonIgnore + public Optional sourceAccountId() { + return sourceAccountId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public SourceAccountBatchCreateResponse withResult(SourceAccount result) { + Utils.checkNotNull(result, "result"); + this.result = Optional.ofNullable(result); + return this; + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public SourceAccountBatchCreateResponse withResult(Optional result) { + Utils.checkNotNull(result, "result"); + this.result = result; + return this; + } + + /** + * Unique ID for the source account. + */ + public SourceAccountBatchCreateResponse withSourceAccountId(String sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + /** + * Unique ID for the source account. + */ + public SourceAccountBatchCreateResponse withSourceAccountId(Optional sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = sourceAccountId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SourceAccountBatchCreateResponse other = (SourceAccountBatchCreateResponse) o; + return + Objects.deepEquals(this.result, other.result) && + Objects.deepEquals(this.sourceAccountId, other.sourceAccountId); + } + + @Override + public int hashCode() { + return Objects.hash( + result, + sourceAccountId); + } + + @Override + public String toString() { + return Utils.toString(SourceAccountBatchCreateResponse.class, + "result", result, + "sourceAccountId", sourceAccountId); + } + + public final static class Builder { + + private Optional result = Optional.empty(); + + private Optional sourceAccountId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public Builder result(SourceAccount result) { + Utils.checkNotNull(result, "result"); + this.result = Optional.ofNullable(result); + return this; + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public Builder result(Optional result) { + Utils.checkNotNull(result, "result"); + this.result = result; + return this; + } + + /** + * Unique ID for the source account. + */ + public Builder sourceAccountId(String sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + /** + * Unique ID for the source account. + */ + public Builder sourceAccountId(Optional sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = sourceAccountId; + return this; + } + + public SourceAccountBatchCreateResponse build() { + return new SourceAccountBatchCreateResponse( + result, + sourceAccountId); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchErrorResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchErrorResponse.java new file mode 100644 index 00000000..ee29846a --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountBatchErrorResponse.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.components; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Objects; +import java.util.Optional; + +/** + * SourceAccountBatchErrorResponse - Describes the error that occured when trying to create the specified source account. + */ + +public class SourceAccountBatchErrorResponse { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("result") + private Optional result; + + /** + * Unique ID for the source account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceAccountId") + private Optional sourceAccountId; + + @JsonCreator + public SourceAccountBatchErrorResponse( + @JsonProperty("result") Optional result, + @JsonProperty("sourceAccountId") Optional sourceAccountId) { + Utils.checkNotNull(result, "result"); + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.result = result; + this.sourceAccountId = sourceAccountId; + } + + public SourceAccountBatchErrorResponse() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional result() { + return (Optional) result; + } + + /** + * Unique ID for the source account. + */ + @JsonIgnore + public Optional sourceAccountId() { + return sourceAccountId; + } + + public final static Builder builder() { + return new Builder(); + } + + public SourceAccountBatchErrorResponse withResult(Result result) { + Utils.checkNotNull(result, "result"); + this.result = Optional.ofNullable(result); + return this; + } + + public SourceAccountBatchErrorResponse withResult(Optional result) { + Utils.checkNotNull(result, "result"); + this.result = result; + return this; + } + + /** + * Unique ID for the source account. + */ + public SourceAccountBatchErrorResponse withSourceAccountId(String sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + /** + * Unique ID for the source account. + */ + public SourceAccountBatchErrorResponse withSourceAccountId(Optional sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = sourceAccountId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SourceAccountBatchErrorResponse other = (SourceAccountBatchErrorResponse) o; + return + Objects.deepEquals(this.result, other.result) && + Objects.deepEquals(this.sourceAccountId, other.sourceAccountId); + } + + @Override + public int hashCode() { + return Objects.hash( + result, + sourceAccountId); + } + + @Override + public String toString() { + return Utils.toString(SourceAccountBatchErrorResponse.class, + "result", result, + "sourceAccountId", sourceAccountId); + } + + public final static class Builder { + + private Optional result = Optional.empty(); + + private Optional sourceAccountId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder result(Result result) { + Utils.checkNotNull(result, "result"); + this.result = Optional.ofNullable(result); + return this; + } + + public Builder result(Optional result) { + Utils.checkNotNull(result, "result"); + this.result = result; + return this; + } + + /** + * Unique ID for the source account. + */ + public Builder sourceAccountId(String sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + /** + * Unique ID for the source account. + */ + public Builder sourceAccountId(Optional sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = sourceAccountId; + return this; + } + + public SourceAccountBatchErrorResponse build() { + return new SourceAccountBatchErrorResponse( + result, + sourceAccountId); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2BatchCreateResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2BatchCreateResponse.java new file mode 100644 index 00000000..f7874834 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/components/SourceAccountV2BatchCreateResponse.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.components; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Objects; +import java.util.Optional; + +/** + * SourceAccountV2BatchCreateResponse - The account ID and source account object of the successfully created source account. + */ + +public class SourceAccountV2BatchCreateResponse { + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("result") + private Optional result; + + /** + * Unique ID for the source account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceAccountId") + private Optional sourceAccountId; + + @JsonCreator + public SourceAccountV2BatchCreateResponse( + @JsonProperty("result") Optional result, + @JsonProperty("sourceAccountId") Optional sourceAccountId) { + Utils.checkNotNull(result, "result"); + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.result = result; + this.sourceAccountId = sourceAccountId; + } + + public SourceAccountV2BatchCreateResponse() { + this(Optional.empty(), Optional.empty()); + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional result() { + return (Optional) result; + } + + /** + * Unique ID for the source account. + */ + @JsonIgnore + public Optional sourceAccountId() { + return sourceAccountId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public SourceAccountV2BatchCreateResponse withResult(SourceAccountV2 result) { + Utils.checkNotNull(result, "result"); + this.result = Optional.ofNullable(result); + return this; + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public SourceAccountV2BatchCreateResponse withResult(Optional result) { + Utils.checkNotNull(result, "result"); + this.result = result; + return this; + } + + /** + * Unique ID for the source account. + */ + public SourceAccountV2BatchCreateResponse withSourceAccountId(String sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + /** + * Unique ID for the source account. + */ + public SourceAccountV2BatchCreateResponse withSourceAccountId(Optional sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = sourceAccountId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SourceAccountV2BatchCreateResponse other = (SourceAccountV2BatchCreateResponse) o; + return + Objects.deepEquals(this.result, other.result) && + Objects.deepEquals(this.sourceAccountId, other.sourceAccountId); + } + + @Override + public int hashCode() { + return Objects.hash( + result, + sourceAccountId); + } + + @Override + public String toString() { + return Utils.toString(SourceAccountV2BatchCreateResponse.class, + "result", result, + "sourceAccountId", sourceAccountId); + } + + public final static class Builder { + + private Optional result = Optional.empty(); + + private Optional sourceAccountId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public Builder result(SourceAccountV2 result) { + Utils.checkNotNull(result, "result"); + this.result = Optional.ofNullable(result); + return this; + } + + /** + * The target bank account in a supported accounting software for ingestion into a bank feed. + */ + public Builder result(Optional result) { + Utils.checkNotNull(result, "result"); + this.result = result; + return this; + } + + /** + * Unique ID for the source account. + */ + public Builder sourceAccountId(String sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = Optional.ofNullable(sourceAccountId); + return this; + } + + /** + * Unique ID for the source account. + */ + public Builder sourceAccountId(Optional sourceAccountId) { + Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + this.sourceAccountId = sourceAccountId; + return this; + } + + public SourceAccountV2BatchCreateResponse build() { + return new SourceAccountV2BatchCreateResponse( + result, + sourceAccountId); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccount1.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccount1.java new file mode 100644 index 00000000..3597462f --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccount1.java @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse; +import io.codat.bank_feeds.models.components.SourceAccountBatchErrorResponse; +import io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse; +import io.codat.bank_feeds.utils.OneOfDeserializer; +import io.codat.bank_feeds.utils.TypedObject; +import io.codat.bank_feeds.utils.Utils.JsonShape; +import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Objects; + + +@JsonDeserialize(using = CreateBatchSourceAccount1._Deserializer.class) +public class CreateBatchSourceAccount1 { + + @JsonValue + private TypedObject value; + + private CreateBatchSourceAccount1(TypedObject value) { + this.value = value; + } + + public static CreateBatchSourceAccount1 of(SourceAccountV2BatchCreateResponse value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccount1(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static CreateBatchSourceAccount1 of(SourceAccountBatchCreateResponse value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccount1(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static CreateBatchSourceAccount1 of(SourceAccountBatchErrorResponse value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccount1(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse}
  • + *
  • {@code io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse}
  • + *
  • {@code io.codat.bank_feeds.models.components.SourceAccountBatchErrorResponse}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBatchSourceAccount1 other = (CreateBatchSourceAccount1) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(CreateBatchSourceAccount1.class, false, + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(CreateBatchSourceAccount1.class, + "value", value); + } + +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java new file mode 100644 index 00000000..073efa8d --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequest.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.codat.bank_feeds.utils.SpeakeasyMetadata; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Objects; +import java.util.Optional; + + +public class CreateBatchSourceAccountRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a connection. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=connectionId") + private String connectionId; + + @JsonCreator + public CreateBatchSourceAccountRequest( + Optional requestBody, + String companyId, + String connectionId) { + Utils.checkNotNull(requestBody, "requestBody"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.requestBody = requestBody; + this.companyId = companyId; + this.connectionId = connectionId; + } + + public CreateBatchSourceAccountRequest( + String companyId, + String connectionId) { + this(Optional.empty(), companyId, connectionId); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestBody() { + return (Optional) requestBody; + } + + /** + * Unique identifier for a company. + */ + @JsonIgnore + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + @JsonIgnore + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateBatchSourceAccountRequest withRequestBody(CreateBatchSourceAccountRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public CreateBatchSourceAccountRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateBatchSourceAccountRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateBatchSourceAccountRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBatchSourceAccountRequest other = (CreateBatchSourceAccountRequest) o; + return + Objects.deepEquals(this.requestBody, other.requestBody) && + Objects.deepEquals(this.companyId, other.companyId) && + Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return Objects.hash( + requestBody, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(CreateBatchSourceAccountRequest.class, + "requestBody", requestBody, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private Optional requestBody = Optional.empty(); + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + public Builder requestBody(CreateBatchSourceAccountRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public Builder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public CreateBatchSourceAccountRequest build() { + return new CreateBatchSourceAccountRequest( + requestBody, + companyId, + connectionId); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java new file mode 100644 index 00000000..8834751a --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBody.java @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.codat.bank_feeds.models.components.SourceAccount; +import io.codat.bank_feeds.models.components.SourceAccountV2; +import io.codat.bank_feeds.utils.OneOfDeserializer; +import io.codat.bank_feeds.utils.TypedObject; +import io.codat.bank_feeds.utils.Utils.JsonShape; +import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; + + +@JsonDeserialize(using = CreateBatchSourceAccountRequestBody._Deserializer.class) +public class CreateBatchSourceAccountRequestBody { + + @JsonValue + private TypedObject value; + + private CreateBatchSourceAccountRequestBody(TypedObject value) { + this.value = value; + } + + public static CreateBatchSourceAccountRequestBody ofSourceAccountV2(List value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccountRequestBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){})); + } + + public static CreateBatchSourceAccountRequestBody ofSourceAccount(List value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccountRequestBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code java.util.List}
  • + *
  • {@code java.util.List}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBatchSourceAccountRequestBody other = (CreateBatchSourceAccountRequestBody) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(CreateBatchSourceAccountRequestBody.class, false, + TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(CreateBatchSourceAccountRequestBody.class, + "value", value); + } + +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java new file mode 100644 index 00000000..1266a63d --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + +import io.codat.bank_feeds.utils.Options; +import io.codat.bank_feeds.utils.RetryConfig; +import io.codat.bank_feeds.utils.Utils; +import java.util.Optional; + +public class CreateBatchSourceAccountRequestBuilder { + + private CreateBatchSourceAccountRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKMethodInterfaces.MethodCallCreateBatchSourceAccount sdk; + + public CreateBatchSourceAccountRequestBuilder(SDKMethodInterfaces.MethodCallCreateBatchSourceAccount sdk) { + this.sdk = sdk; + } + + public CreateBatchSourceAccountRequestBuilder request(CreateBatchSourceAccountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateBatchSourceAccountRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public CreateBatchSourceAccountRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CreateBatchSourceAccountResponse call() throws Exception { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.createBatch( + request, + options); + } +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java new file mode 100644 index 00000000..ac6c9520 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponse.java @@ -0,0 +1,310 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.codat.bank_feeds.utils.Response; +import io.codat.bank_feeds.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Objects; +import java.util.Optional; + + +public class CreateBatchSourceAccountResponse implements Response { + + /** + * Success + */ + private Optional twoHundredApplicationJsonOneOf; + + /** + * Multi-Status + */ + private Optional twoHundredAndSevenApplicationJsonOneOf; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public CreateBatchSourceAccountResponse( + Optional twoHundredApplicationJsonOneOf, + Optional twoHundredAndSevenApplicationJsonOneOf, + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf"); + Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.twoHundredApplicationJsonOneOf = twoHundredApplicationJsonOneOf; + this.twoHundredAndSevenApplicationJsonOneOf = twoHundredAndSevenApplicationJsonOneOf; + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + public CreateBatchSourceAccountResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(Optional.empty(), Optional.empty(), contentType, statusCode, rawResponse); + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional twoHundredApplicationJsonOneOf() { + return (Optional) twoHundredApplicationJsonOneOf; + } + + /** + * Multi-Status + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional twoHundredAndSevenApplicationJsonOneOf() { + return (Optional) twoHundredAndSevenApplicationJsonOneOf; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateBatchSourceAccountResponse withTwoHundredApplicationJsonOneOf(CreateBatchSourceAccountResponseBody twoHundredApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf"); + this.twoHundredApplicationJsonOneOf = Optional.ofNullable(twoHundredApplicationJsonOneOf); + return this; + } + + /** + * Success + */ + public CreateBatchSourceAccountResponse withTwoHundredApplicationJsonOneOf(Optional twoHundredApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf"); + this.twoHundredApplicationJsonOneOf = twoHundredApplicationJsonOneOf; + return this; + } + + /** + * Multi-Status + */ + public CreateBatchSourceAccountResponse withTwoHundredAndSevenApplicationJsonOneOf(CreateBatchSourceAccountSourceAccountsResponseBody twoHundredAndSevenApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf"); + this.twoHundredAndSevenApplicationJsonOneOf = Optional.ofNullable(twoHundredAndSevenApplicationJsonOneOf); + return this; + } + + /** + * Multi-Status + */ + public CreateBatchSourceAccountResponse withTwoHundredAndSevenApplicationJsonOneOf(Optional twoHundredAndSevenApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf"); + this.twoHundredAndSevenApplicationJsonOneOf = twoHundredAndSevenApplicationJsonOneOf; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateBatchSourceAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateBatchSourceAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateBatchSourceAccountResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBatchSourceAccountResponse other = (CreateBatchSourceAccountResponse) o; + return + Objects.deepEquals(this.twoHundredApplicationJsonOneOf, other.twoHundredApplicationJsonOneOf) && + Objects.deepEquals(this.twoHundredAndSevenApplicationJsonOneOf, other.twoHundredAndSevenApplicationJsonOneOf) && + Objects.deepEquals(this.contentType, other.contentType) && + Objects.deepEquals(this.statusCode, other.statusCode) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + twoHundredApplicationJsonOneOf, + twoHundredAndSevenApplicationJsonOneOf, + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateBatchSourceAccountResponse.class, + "twoHundredApplicationJsonOneOf", twoHundredApplicationJsonOneOf, + "twoHundredAndSevenApplicationJsonOneOf", twoHundredAndSevenApplicationJsonOneOf, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional twoHundredApplicationJsonOneOf = Optional.empty(); + + private Optional twoHundredAndSevenApplicationJsonOneOf = Optional.empty(); + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder twoHundredApplicationJsonOneOf(CreateBatchSourceAccountResponseBody twoHundredApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf"); + this.twoHundredApplicationJsonOneOf = Optional.ofNullable(twoHundredApplicationJsonOneOf); + return this; + } + + /** + * Success + */ + public Builder twoHundredApplicationJsonOneOf(Optional twoHundredApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredApplicationJsonOneOf, "twoHundredApplicationJsonOneOf"); + this.twoHundredApplicationJsonOneOf = twoHundredApplicationJsonOneOf; + return this; + } + + /** + * Multi-Status + */ + public Builder twoHundredAndSevenApplicationJsonOneOf(CreateBatchSourceAccountSourceAccountsResponseBody twoHundredAndSevenApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf"); + this.twoHundredAndSevenApplicationJsonOneOf = Optional.ofNullable(twoHundredAndSevenApplicationJsonOneOf); + return this; + } + + /** + * Multi-Status + */ + public Builder twoHundredAndSevenApplicationJsonOneOf(Optional twoHundredAndSevenApplicationJsonOneOf) { + Utils.checkNotNull(twoHundredAndSevenApplicationJsonOneOf, "twoHundredAndSevenApplicationJsonOneOf"); + this.twoHundredAndSevenApplicationJsonOneOf = twoHundredAndSevenApplicationJsonOneOf; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CreateBatchSourceAccountResponse build() { + return new CreateBatchSourceAccountResponse( + twoHundredApplicationJsonOneOf, + twoHundredAndSevenApplicationJsonOneOf, + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java new file mode 100644 index 00000000..1d273ff9 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountResponseBody.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.codat.bank_feeds.utils.OneOfDeserializer; +import io.codat.bank_feeds.utils.TypedObject; +import io.codat.bank_feeds.utils.Utils.JsonShape; +import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; + +/** + * CreateBatchSourceAccountResponseBody - Success + */ + +@JsonDeserialize(using = CreateBatchSourceAccountResponseBody._Deserializer.class) +public class CreateBatchSourceAccountResponseBody { + + @JsonValue + private TypedObject value; + + private CreateBatchSourceAccountResponseBody(TypedObject value) { + this.value = value; + } + + public static CreateBatchSourceAccountResponseBody of(List value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccountResponseBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code java.util.List}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBatchSourceAccountResponseBody other = (CreateBatchSourceAccountResponseBody) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(CreateBatchSourceAccountResponseBody.class, false, + TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(CreateBatchSourceAccountResponseBody.class, + "value", value); + } + +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java new file mode 100644 index 00000000..cf8d8174 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/CreateBatchSourceAccountSourceAccountsResponseBody.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.codat.bank_feeds.utils.OneOfDeserializer; +import io.codat.bank_feeds.utils.TypedObject; +import io.codat.bank_feeds.utils.Utils.JsonShape; +import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Objects; + +/** + * CreateBatchSourceAccountSourceAccountsResponseBody - Multi-Status + */ + +@JsonDeserialize(using = CreateBatchSourceAccountSourceAccountsResponseBody._Deserializer.class) +public class CreateBatchSourceAccountSourceAccountsResponseBody { + + @JsonValue + private TypedObject value; + + private CreateBatchSourceAccountSourceAccountsResponseBody(TypedObject value) { + this.value = value; + } + + public static CreateBatchSourceAccountSourceAccountsResponseBody of(List value) { + Utils.checkNotNull(value, "value"); + return new CreateBatchSourceAccountSourceAccountsResponseBody(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference>(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code java.util.List}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBatchSourceAccountSourceAccountsResponseBody other = (CreateBatchSourceAccountSourceAccountsResponseBody) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(CreateBatchSourceAccountSourceAccountsResponseBody.class, false, + TypeReferenceWithShape.of(new TypeReference>() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(CreateBatchSourceAccountSourceAccountsResponseBody.class, + "value", value); + } + +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java new file mode 100644 index 00000000..cd262458 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequest.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.codat.bank_feeds.utils.SpeakeasyMetadata; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetCompanyAccessTokenRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + @JsonCreator + public GetCompanyAccessTokenRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + @JsonIgnore + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCompanyAccessTokenRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCompanyAccessTokenRequest other = (GetCompanyAccessTokenRequest) o; + return + Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetCompanyAccessTokenRequest.class, + "companyId", companyId); + } + + public final static class Builder { + + private String companyId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public GetCompanyAccessTokenRequest build() { + return new GetCompanyAccessTokenRequest( + companyId); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java new file mode 100644 index 00000000..0107e9b4 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + +import io.codat.bank_feeds.utils.Options; +import io.codat.bank_feeds.utils.RetryConfig; +import io.codat.bank_feeds.utils.Utils; +import java.util.Optional; + +public class GetCompanyAccessTokenRequestBuilder { + + private GetCompanyAccessTokenRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetCompanyAccessToken sdk; + + public GetCompanyAccessTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetCompanyAccessToken sdk) { + this.sdk = sdk; + } + + public GetCompanyAccessTokenRequestBuilder request(GetCompanyAccessTokenRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCompanyAccessTokenRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetCompanyAccessTokenRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public GetCompanyAccessTokenResponse call() throws Exception { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getAccessToken( + request, + options); + } +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java new file mode 100644 index 00000000..cea5fd14 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCompanyAccessTokenResponse.java @@ -0,0 +1,252 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.codat.bank_feeds.models.components.CompanyAccessToken; +import io.codat.bank_feeds.utils.Response; +import io.codat.bank_feeds.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Objects; +import java.util.Optional; + + +public class GetCompanyAccessTokenResponse implements Response { + + /** + * OK + */ + private Optional companyAccessToken; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetCompanyAccessTokenResponse( + Optional companyAccessToken, + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(companyAccessToken, "companyAccessToken"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.companyAccessToken = companyAccessToken; + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + public GetCompanyAccessTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(Optional.empty(), contentType, statusCode, rawResponse); + } + + /** + * OK + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional companyAccessToken() { + return (Optional) companyAccessToken; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCompanyAccessTokenResponse withCompanyAccessToken(CompanyAccessToken companyAccessToken) { + Utils.checkNotNull(companyAccessToken, "companyAccessToken"); + this.companyAccessToken = Optional.ofNullable(companyAccessToken); + return this; + } + + /** + * OK + */ + public GetCompanyAccessTokenResponse withCompanyAccessToken(Optional companyAccessToken) { + Utils.checkNotNull(companyAccessToken, "companyAccessToken"); + this.companyAccessToken = companyAccessToken; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCompanyAccessTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCompanyAccessTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanyAccessTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCompanyAccessTokenResponse other = (GetCompanyAccessTokenResponse) o; + return + Objects.deepEquals(this.companyAccessToken, other.companyAccessToken) && + Objects.deepEquals(this.contentType, other.contentType) && + Objects.deepEquals(this.statusCode, other.statusCode) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + companyAccessToken, + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCompanyAccessTokenResponse.class, + "companyAccessToken", companyAccessToken, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional companyAccessToken = Optional.empty(); + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder companyAccessToken(CompanyAccessToken companyAccessToken) { + Utils.checkNotNull(companyAccessToken, "companyAccessToken"); + this.companyAccessToken = Optional.ofNullable(companyAccessToken); + return this; + } + + /** + * OK + */ + public Builder companyAccessToken(Optional companyAccessToken) { + Utils.checkNotNull(companyAccessToken, "companyAccessToken"); + this.companyAccessToken = companyAccessToken; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetCompanyAccessTokenResponse build() { + return new GetCompanyAccessTokenResponse( + companyAccessToken, + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java new file mode 100644 index 00000000..2352abd6 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequest.java @@ -0,0 +1,183 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.codat.bank_feeds.utils.SpeakeasyMetadata; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; + + +public class GetCreateBankTransactionsModelRequest { + + /** + * Unique identifier for an account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=accountId") + private String accountId; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a connection. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=connectionId") + private String connectionId; + + @JsonCreator + public GetCreateBankTransactionsModelRequest( + String accountId, + String companyId, + String connectionId) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.accountId = accountId; + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for an account. + */ + @JsonIgnore + public String accountId() { + return accountId; + } + + /** + * Unique identifier for a company. + */ + @JsonIgnore + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + @JsonIgnore + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an account. + */ + public GetCreateBankTransactionsModelRequest withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetCreateBankTransactionsModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreateBankTransactionsModelRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCreateBankTransactionsModelRequest other = (GetCreateBankTransactionsModelRequest) o; + return + Objects.deepEquals(this.accountId, other.accountId) && + Objects.deepEquals(this.companyId, other.companyId) && + Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return Objects.hash( + accountId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreateBankTransactionsModelRequest.class, + "accountId", accountId, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String accountId; + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreateBankTransactionsModelRequest build() { + return new GetCreateBankTransactionsModelRequest( + accountId, + companyId, + connectionId); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java new file mode 100644 index 00000000..50092af7 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + +import io.codat.bank_feeds.utils.Options; +import io.codat.bank_feeds.utils.RetryConfig; +import io.codat.bank_feeds.utils.Utils; +import java.util.Optional; + +public class GetCreateBankTransactionsModelRequestBuilder { + + private GetCreateBankTransactionsModelRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKMethodInterfaces.MethodCallGetCreateBankTransactionsModel sdk; + + public GetCreateBankTransactionsModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateBankTransactionsModel sdk) { + this.sdk = sdk; + } + + public GetCreateBankTransactionsModelRequestBuilder request(GetCreateBankTransactionsModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateBankTransactionsModelRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public GetCreateBankTransactionsModelRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public GetCreateBankTransactionsModelResponse call() throws Exception { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + return sdk.getCreateModel( + request, + options); + } +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java new file mode 100644 index 00000000..f7a62656 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/GetCreateBankTransactionsModelResponse.java @@ -0,0 +1,252 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.codat.bank_feeds.models.components.PushOption; +import io.codat.bank_feeds.utils.Response; +import io.codat.bank_feeds.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Objects; +import java.util.Optional; + + +public class GetCreateBankTransactionsModelResponse implements Response { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetCreateBankTransactionsModelResponse( + String contentType, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + public GetCreateBankTransactionsModelResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, Optional.empty(), statusCode, rawResponse); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * Success + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional pushOption() { + return (Optional) pushOption; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateBankTransactionsModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public GetCreateBankTransactionsModelResponse withPushOption(PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * Success + */ + public GetCreateBankTransactionsModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateBankTransactionsModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateBankTransactionsModelResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCreateBankTransactionsModelResponse other = (GetCreateBankTransactionsModelResponse) o; + return + Objects.deepEquals(this.contentType, other.contentType) && + Objects.deepEquals(this.pushOption, other.pushOption) && + Objects.deepEquals(this.statusCode, other.statusCode) && + Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + contentType, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateBankTransactionsModelResponse.class, + "contentType", contentType, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional pushOption = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public Builder pushOption(PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * Success + */ + public Builder pushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetCreateBankTransactionsModelResponse build() { + return new GetCreateBankTransactionsModelResponse( + contentType, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java new file mode 100644 index 00000000..eb58d6e1 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/One.java @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.models.operations; + + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse; +import io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse; +import io.codat.bank_feeds.utils.OneOfDeserializer; +import io.codat.bank_feeds.utils.TypedObject; +import io.codat.bank_feeds.utils.Utils.JsonShape; +import io.codat.bank_feeds.utils.Utils.TypeReferenceWithShape; +import io.codat.bank_feeds.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Objects; + + +@JsonDeserialize(using = One._Deserializer.class) +public class One { + + @JsonValue + private TypedObject value; + + private One(TypedObject value) { + this.value = value; + } + + public static One of(SourceAccountV2BatchCreateResponse value) { + Utils.checkNotNull(value, "value"); + return new One(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + public static One of(SourceAccountBatchCreateResponse value) { + Utils.checkNotNull(value, "value"); + return new One(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference(){})); + } + + /** + * Returns an instance of one of these types: + *
    + *
  • {@code io.codat.bank_feeds.models.components.SourceAccountV2BatchCreateResponse}
  • + *
  • {@code io.codat.bank_feeds.models.components.SourceAccountBatchCreateResponse}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + One other = (One) o; + return Objects.deepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Objects.hash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(One.class, false, + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(One.class, + "value", value); + } + +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java index 1371db3c..2e2605ec 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/models/operations/SDKMethodInterfaces.java @@ -33,6 +33,13 @@ GetCompanyResponse get( } + public interface MethodCallGetCompanyAccessToken { + GetCompanyAccessTokenResponse getAccessToken( + GetCompanyAccessTokenRequest request, + Optional options) throws Exception; + } + + public interface MethodCallListCompanies { ListCompaniesResponse list( ListCompaniesRequest request, @@ -110,6 +117,13 @@ CreateSourceAccountResponse create( } + public interface MethodCallCreateBatchSourceAccount { + CreateBatchSourceAccountResponse createBatch( + CreateBatchSourceAccountRequest request, + Optional options) throws Exception; + } + + public interface MethodCallDeleteSourceAccount { DeleteSourceAccountResponse delete( DeleteSourceAccountRequest request, @@ -173,6 +187,13 @@ CreateBankTransactionsResponse create( } + public interface MethodCallGetCreateBankTransactionsModel { + GetCreateBankTransactionsModelResponse getCreateModel( + GetCreateBankTransactionsModelRequest request, + Optional options) throws Exception; + } + + public interface MethodCallGetCreateOperation { GetCreateOperationResponse getCreateOperation( GetCreateOperationRequest request, diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java index 55737da8..de3e5d05 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/HTTPRequest.java @@ -4,6 +4,7 @@ package io.codat.bank_feeds.utils; +import java.net.URI; import java.net.URISyntaxException; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublisher; @@ -15,15 +16,15 @@ import java.util.Map; import java.util.Optional; -import org.apache.http.NameValuePair; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.message.BasicNameValuePair; - public class HTTPRequest { + private static final String FRAGMENT_SEGMENT_START = "#"; + private static final String QUERY_NAME_VALUE_DELIMITER = "="; + private static final String QUERY_PARAMETER_DELIMITER = "&"; + private static final String QUERY_SEGMENT_START = "?"; private final String baseURL; private final String method; - private final List queryParams = new ArrayList<>(); + private final List queryParams = new ArrayList<>(); private final Map> headers = new HashMap<>(); private Optional body = Optional.empty(); // mutable @@ -54,21 +55,21 @@ public HTTPRequest addHeaders(Map> map) { return this; } - public HTTPRequest addQueryParam(String name, String value) { - addQueryParam(new BasicNameValuePair(name, value)); + public HTTPRequest addQueryParam(QueryParameter param) { + this.queryParams.add(param); return this; } - - public HTTPRequest addQueryParam(NameValuePair param) { - this.queryParams.add(param); + + public HTTPRequest addQueryParam(String key, String value, boolean allowReserved) { + this.queryParams.add(QueryParameter.of(key, value, allowReserved)); return this; } - public HTTPRequest addQueryParams(Collection params) { + public HTTPRequest addQueryParams(Collection params) { params.forEach(p -> addQueryParam(p)); return this; } - + public HttpRequest build() { HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(); @@ -81,14 +82,49 @@ public HttpRequest build() { } requestBuilder.method(method, bodyPublisher); try { - URIBuilder b = new URIBuilder(this.baseURL); - queryParams.forEach(pair -> b.addParameter(pair.getName(), pair.getValue())); - requestBuilder.uri(b.build()); + requestBuilder.uri(new URI(buildUrl(baseURL, queryParams))); } catch (URISyntaxException e) { throw new RuntimeException(e); } headers.forEach((k, list) -> list.forEach(v -> requestBuilder.header(k, v))); return requestBuilder.build(); } - + + // VisibleForTesting + public static String buildUrl(String baseURL, Collection queryParams) { + if (queryParams.isEmpty()) { + return baseURL; + } else { + final String base; + final String fragment; + int i = baseURL.indexOf(FRAGMENT_SEGMENT_START); + if (i == -1) { + base = baseURL; + fragment = ""; + } else { + base = baseURL.substring(0, i); + fragment = baseURL.substring(i); + } + StringBuilder b = new StringBuilder(base); + if (!base.contains(QUERY_SEGMENT_START)) { + b.append(QUERY_SEGMENT_START); + } else { + b.append(QUERY_PARAMETER_DELIMITER); + } + boolean first = true; + for (QueryParameter p : queryParams) { + if (!first) { + b.append(QUERY_PARAMETER_DELIMITER); + } + first = false; + // don't allow reserved characters to be unencoded in key (??) + b.append(Utf8UrlEncoder.DEFAULT.encode(p.name())); + b.append(QUERY_NAME_VALUE_DELIMITER); + b.append(Utf8UrlEncoder.allowReserved(p.allowReserved()).encode(p.value())); + } + b.append(fragment); + return b.toString(); + } + } + } \ No newline at end of file diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java index 76e3632c..b877b6e0 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/PathParamsMetadata.java @@ -8,15 +8,17 @@ class PathParamsMetadata { + // these fields set via reflection + String style = "simple"; boolean explode; String name; String serialization; + boolean allowReserved; private PathParamsMetadata() { } - // pathParam:style=simple,explode=false,name=apiID static PathParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { return Metadata.parse("pathParam", new PathParamsMetadata(), field); } diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java new file mode 100644 index 00000000..8a2e0c1f --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameter.java @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.utils; + +import java.util.Objects; + +// internal class, not for public use +// TODO move to internal package +public final class QueryParameter { + + private final String name; + private final String value; + private final boolean allowReserved; + + private QueryParameter(String name, String value, boolean allowReserved) { + this.name = name; + this.value = value; + this.allowReserved = allowReserved; + } + + public static QueryParameter of(String name, String value, boolean allowReserved) { + return new QueryParameter(name, value, allowReserved); + } + + public String name() { + return name; + } + + public String value() { + return value; + } + + public boolean allowReserved() { + return allowReserved; + } + + @Override + public String toString() { + return "QueryParameter [name=" + name + ", value=" + value + ", allowReserved=" + allowReserved + "]"; + } + + @Override + public int hashCode() { + return Objects.hash(allowReserved, name, value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + QueryParameter other = (QueryParameter) obj; + return allowReserved == other.allowReserved && Objects.equals(name, other.name) + && Objects.equals(value, other.value); + } + +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java index aff3f177..8d44fa6c 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParameters.java @@ -11,16 +11,13 @@ import java.util.Map; import java.util.stream.Collectors; -import org.apache.http.NameValuePair; -import org.apache.http.message.BasicNameValuePair; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class QueryParameters { - public static List parseQueryParams(Class type, T queryParams, + public static List parseQueryParams(Class type, T queryParams, Map>> globals) throws Exception { - List allParams = new ArrayList<>(); + List allParams = new ArrayList<>(); Field[] fields = type.getDeclaredFields(); @@ -45,20 +42,20 @@ public static List parseQueryParams(Class t } if (queryParamsMetadata.serialization != null && !queryParamsMetadata.serialization.isBlank()) { - List params = parseSerializedParams(queryParamsMetadata, value); + List params = parseSerializedParams(queryParamsMetadata, value); allParams.addAll(params); } else { switch (queryParamsMetadata.style) { case "form": - List formParams = parseDelimitedParams(queryParamsMetadata, value, ","); + List formParams = parseDelimitedParams(queryParamsMetadata, value, ","); allParams.addAll(formParams); break; case "deepObject": - List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value); + List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value); allParams.addAll(deepObjectParams); break; case "pipeDelimited": - List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|"); + List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|"); allParams.addAll(pipeDelimitedParams); break; default: @@ -70,14 +67,14 @@ public static List parseQueryParams(Class t return allParams; } - private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value) + private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value) throws JsonProcessingException { - List params = new ArrayList<>(); + List params = new ArrayList<>(); switch (queryParamsMetadata.serialization) { case "json": ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(value); - params.add(new BasicNameValuePair(queryParamsMetadata.name, json)); + params.add(QueryParameter.of(queryParamsMetadata.name, json, queryParamsMetadata.allowReserved)); break; default: break; @@ -85,9 +82,9 @@ private static List parseSerializedParams(QueryParamsMetadata que return params; } - private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter) + private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter) throws IllegalArgumentException, IllegalAccessException { - List params = new ArrayList<>(); + List params = new ArrayList<>(); switch (Types.getType(value.getClass())) { case ARRAY: { @@ -107,7 +104,7 @@ private static List parseDelimitedParams(QueryParamsMetadata quer values.add(String.join(delimiter, items)); } - params.addAll(values.stream().map(v -> new BasicNameValuePair(queryParamsMetadata.name, v)) + params.addAll(values.stream().map(v -> QueryParameter.of(queryParamsMetadata.name, v, queryParamsMetadata.allowReserved)) .collect(Collectors.toList())); break; } @@ -121,20 +118,20 @@ private static List parseDelimitedParams(QueryParamsMetadata quer String val = Utils.valToString(entry.getValue()); if (queryParamsMetadata.explode) { - params.add(new BasicNameValuePair(key, val)); + params.add(QueryParameter.of(key, val, queryParamsMetadata.allowReserved)); } else { items.add(String.format("%s%s%s", key, delimiter, val)); } } if (items.size() > 0) { - params.add(new BasicNameValuePair(queryParamsMetadata.name, String.join(delimiter, items))); + params.add(QueryParameter.of(queryParamsMetadata.name, String.join(delimiter, items), queryParamsMetadata.allowReserved)); } break; } case OBJECT: { if (!Utils.allowIntrospection(value.getClass())) { - params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value))); + params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved)); break; } Field[] fields = value.getClass().getDeclaredFields(); @@ -155,29 +152,29 @@ private static List parseDelimitedParams(QueryParamsMetadata quer } if (queryParamsMetadata.explode) { - params.add(new BasicNameValuePair(metadata.name, Utils.valToString(val))); + params.add(QueryParameter.of(metadata.name, Utils.valToString(val), metadata.allowReserved)); } else { items.add(String.format("%s%s%s", metadata.name, delimiter, Utils.valToString(val))); } } if (items.size() > 0) { - params.add(new BasicNameValuePair(queryParamsMetadata.name, String.join(delimiter, items))); + params.add(QueryParameter.of(queryParamsMetadata.name, String.join(delimiter, items), queryParamsMetadata.allowReserved)); } break; } default: - params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value))); + params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved)); break; } return params; } - private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value) + private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value) throws Exception { - List params = new ArrayList<>(); + List params = new ArrayList<>(); switch (Types.getType(value.getClass())) { case MAP: { @@ -189,12 +186,12 @@ private static List parseDeepObjectParams(QueryParamsMetadata que if (val instanceof List || val.getClass().isArray()) { for (Object v : Utils.toList(val)) { - params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key), - Utils.valToString(v))); + params.add(QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, key), + Utils.valToString(v), queryParamsMetadata.allowReserved)); } } else { - params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key), - Utils.valToString(val))); + params.add(QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, key), + Utils.valToString(val), queryParamsMetadata.allowReserved)); } } @@ -221,14 +218,14 @@ private static List parseDeepObjectParams(QueryParamsMetadata que if (val instanceof List || val.getClass().isArray()) { for (Object v : Utils.toList(val)) { - params.add(new BasicNameValuePair( + params.add(QueryParameter.of( String.format("%s[%s]", queryParamsMetadata.name, metadata.name), - Utils.valToString(v))); + Utils.valToString(v), metadata.allowReserved)); } } else { params.add( - new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, metadata.name), - Utils.valToString(val))); + QueryParameter.of(String.format("%s[%s]", queryParamsMetadata.name, metadata.name), + Utils.valToString(val), metadata.allowReserved)); } } diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java index e75f211a..ee919309 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/QueryParamsMetadata.java @@ -8,12 +8,14 @@ class QueryParamsMetadata { + // these parameters set via reflection + String style = "form"; boolean explode = true; String name; String serialization; + boolean allowReserved; - // queryParam:style=simple,explode=false,name=apiID static QueryParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { return Metadata.parse("queryParam", new QueryParamsMetadata(), field); } diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java index 6affb5ac..66da5493 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Security.java @@ -108,7 +108,7 @@ private static void parseSecuritySchemeValue(HTTPRequest request, SecurityMetada break; case "query": request.addQueryParam( - securityMetadata.name, Utils.valToString(value)); + securityMetadata.name, Utils.valToString(value), false); break; case "cookie": request.addHeader("Cookie", diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java new file mode 100644 index 00000000..ada7f1c4 --- /dev/null +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utf8UrlEncoder.java @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +package io.codat.bank_feeds.utils; + +import java.io.CharArrayWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.BitSet; +import java.util.Objects; + +// Internal use only +// TODO move to an internal package +public final class Utf8UrlEncoder { + + private static final BitSet DO_NOT_ENCODE_CHARS = createDoNotEncodeChars(); + private static final int CASE_DIFF = ('a' - 'A'); + + private final BitSet safeChars; + + public static final Utf8UrlEncoder ALLOW_RESERVED = new Utf8UrlEncoder(":/?#[]@!$&'()*+,;="); + public static final Utf8UrlEncoder DEFAULT = new Utf8UrlEncoder(""); + + public static Utf8UrlEncoder allowReserved(boolean allowReserved) { + return allowReserved ? ALLOW_RESERVED : DEFAULT; + } + + private Utf8UrlEncoder(String safeCharacters) { + Objects.requireNonNull(safeCharacters, "safeCharacters"); + int max = -1; + for (int i = 0; i < safeCharacters.length(); i++) { + char ch = safeCharacters.charAt(i); + max = Math.max(ch, max); + } + BitSet safeChars = new BitSet(max + 1); + for (int i = 0; i < safeCharacters.length(); i++) { + char ch = safeCharacters.charAt(i); + safeChars.set(ch); + } + this.safeChars = safeChars; + } + + public String encode(String s) { + return encode(s, StandardCharsets.UTF_8); + } + + private String encode(String s, Charset charset) { + boolean changed = false; + StringBuilder out = new StringBuilder(s.length()); + CharArrayWriter writer = new CharArrayWriter(); + + for (int i = 0; i < s.length();) { + int c = (int) s.charAt(i); + if (DO_NOT_ENCODE_CHARS.get(c) || safeChars.get(c)) { + out.append((char) c); + i++; + } else { + // convert to external encoding before hex conversion + do { + writer.write(c); + if (c >= 0xD800 && c <= 0xDBFF) { + if ((i + 1) < s.length()) { + int d = (int) s.charAt(i + 1); + if (d >= 0xDC00 && d <= 0xDFFF) { + writer.write(d); + i++; + } + } + } + i++; + } while (i < s.length() && !DO_NOT_ENCODE_CHARS.get((c = (int) s.charAt(i)))); + + writer.flush(); + String str = new String(writer.toCharArray()); + byte[] ba = str.getBytes(charset); + for (int j = 0; j < ba.length; j++) { + out.append('%'); + char ch = Character.forDigit((ba[j] >> 4) & 0xF, 16); + // converting to use uppercase letter as part of + // the hex value if ch is a letter. + if (Character.isLetter(ch)) { + ch -= CASE_DIFF; + } + out.append(ch); + ch = Character.forDigit(ba[j] & 0xF, 16); + if (Character.isLetter(ch)) { + ch -= CASE_DIFF; + } + out.append(ch); + } + writer.reset(); + changed = true; + } + } + + return (changed ? out.toString() : s); + } + + private static BitSet createDoNotEncodeChars() { + BitSet b = new BitSet(256); + for (int i = 'a'; i <= 'z'; i++) { + b.set(i); + } + for (int i = 'A'; i <= 'Z'; i++) { + b.set(i); + } + for (int i = '0'; i <= '9'; i++) { + b.set(i); + } + b.set('-'); + b.set('_'); + b.set('.'); + b.set('*'); + return b; + } +} diff --git a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java index 3277c66e..a2553537 100644 --- a/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java +++ b/bank-feeds/src/main/java/io/codat/bank_feeds/utils/Utils.java @@ -15,7 +15,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.net.URI; -import java.net.URISyntaxException; import java.net.URLEncoder; import java.net.http.HttpClient.Version; import java.net.http.HttpHeaders; @@ -144,7 +143,9 @@ public static String generateURL(Class type, String baseURL, String path, pathParams.put(pathParamsMetadata.name, String.join(",", - array.stream().map(v -> valToString(v)) + array.stream() + .map(v -> valToString(v)) + .map(v -> pathEncode(v, pathParamsMetadata.allowReserved)) .collect(Collectors.toList()))); break; case MAP: @@ -156,17 +157,17 @@ public static String generateURL(Class type, String baseURL, String path, pathParams.put(pathParamsMetadata.name, String.join(",", map.entrySet().stream().map(e -> { if (pathParamsMetadata.explode) { - return String.format("%s=%s", valToString(e.getKey()), - valToString(e.getValue())); + return String.format("%s=%s", pathEncode(valToString(e.getKey()), false), + pathEncode(valToString(e.getValue()), false)); } else { - return String.format("%s,%s", valToString(e.getKey()), - valToString(e.getValue())); + return String.format("%s,%s", pathEncode(valToString(e.getKey()), false), + pathEncode(valToString(e.getValue()), false)); } }).collect(Collectors.toList()))); break; case OBJECT: if (!allowIntrospection(value.getClass())) { - pathParams.put(pathParamsMetadata.name, valToString(value)); + pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved)); break; } List values = new ArrayList<>(); @@ -187,17 +188,17 @@ public static String generateURL(Class type, String baseURL, String path, if (pathParamsMetadata.explode) { values.add(String.format("%s=%s", valuePathParamsMetadata.name, - valToString(val))); + pathEncode(valToString(val), valuePathParamsMetadata.allowReserved))); } else { values.add(String.format("%s,%s", valuePathParamsMetadata.name, - valToString(val))); + pathEncode(valToString(val), valuePathParamsMetadata.allowReserved))); } } pathParams.put(pathParamsMetadata.name, String.join(",", values)); break; default: - pathParams.put(pathParamsMetadata.name, valToString(value)); + pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved)); break; } } @@ -206,6 +207,10 @@ public static String generateURL(Class type, String baseURL, String path, return baseURL + templateUrl(path, pathParams); } + + private static String pathEncode(String s, boolean allowReserved) { + return Utf8UrlEncoder.allowReserved(allowReserved).encode(s); + } public static boolean contentTypeMatches(String contentType, String pattern) { if (contentType == null || contentType.isBlank()) { @@ -256,7 +261,7 @@ public static SerializedBody serializeRequestBody(Object request, String request return RequestBody.serialize(request, requestField, serializationMethod, nullable); } - public static List getQueryParams(Class type, Optional params, + public static List getQueryParams(Class type, Optional params, Map>> globals) throws Exception { if (params.isEmpty()) { return Collections.emptyList(); @@ -265,7 +270,7 @@ public static List getQueryParams(Class typ } } - public static List getQueryParams(Class type, JsonNullable params, + public static List getQueryParams(Class type, JsonNullable params, Map>> globals) throws Exception { if (!params.isPresent() || params.get() == null) { return Collections.emptyList(); @@ -274,7 +279,7 @@ public static List getQueryParams(Class typ } } - public static List getQueryParams(Class type, T params, + public static List getQueryParams(Class type, T params, Map>> globals) throws Exception { return QueryParameters.parseQueryParams(type, params, globals); } @@ -282,6 +287,8 @@ public static List getQueryParams(Class typ public static HTTPRequest configureSecurity(HTTPRequest request, Object security) throws Exception { return Security.configureSecurity(request, security); } + + private static final String DOLLAR_MARKER = "D9qPtyhOYzkHGu3c"; public static String templateUrl(String url, Map params) { StringBuilder sb = new StringBuilder(); @@ -294,12 +301,16 @@ public static String templateUrl(String url, Map params) { String key = match.substring(1, match.length() - 1); String value = params.get(key); if (value != null) { - m.appendReplacement(sb, URLEncoder.encode(value, StandardCharsets.UTF_8)); + // note that we replace $ characters in values with a marker + // and then replace the markers at the end with the $ characters + // because the presence of dollar signs can stuff up the next + // regex find + m.appendReplacement(sb, value.replace("$", DOLLAR_MARKER)); } } m.appendTail(sb); - return sb.toString(); + return sb.toString().replace(DOLLAR_MARKER, "$"); } public static Map> getHeadersFromMetadata(Object headers, Map>> globals) throws Exception { @@ -474,7 +485,7 @@ private static Map parseSerializedParams(PathParamsMetadata path case "json": ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(value); - params.put(pathParamsMetadata.name, json); + params.put(pathParamsMetadata.name, pathEncode(json, pathParamsMetadata.allowReserved)); break; default: break; @@ -1167,18 +1178,18 @@ public static boolean isPresentAndNotNull(JsonNullable x) { return x.isPresent() && x.get() != null; } - private static final String OPEN_BRACKET_MARKER = UUID.randomUUID().toString().replace("-", ""); - private static final String CLOSE_BRACKET_MARKER = UUID.randomUUID().toString().replace("-", ""); - - public static String urlEncode(String s) { - // Ensure that complies with RFC 2732 (URLEncoder does not and we don't want to - // encode [, ] chars) - return URLEncoder.encode( // - s.replace("[", OPEN_BRACKET_MARKER) // - .replace("]", CLOSE_BRACKET_MARKER), // - StandardCharsets.UTF_8) // - .replace(OPEN_BRACKET_MARKER, "[") // - .replace(CLOSE_BRACKET_MARKER, "]"); + public static void setSseSentinel(Object o, String value) { + if (o == null || value.isBlank()) { + return; + } else { + try { + Field field = o.getClass().getDeclaredField("_eventSentinel"); + field.setAccessible(true); + field.set(o, Optional.of(value)); + } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { + // ignore + } + } } }